Allow infoboxes to be disabled (#972)

* Allow infoboxes to be disabled

* Document `infoboxes` default value

* Rename `infoboxes` to `auto_info`

* Document `auto-info`

* Fix incomplete rename
This commit is contained in:
Omnikar 2021-11-04 22:25:08 -04:00 committed by GitHub
parent 51b4d35dce
commit cfc8285867
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View file

@ -22,6 +22,7 @@ To override global configuration parameters, create a `config.toml` file located
| `auto-completion` | Enable automatic pop up of auto-completion. | `true` |
| `idle-timeout` | Time in milliseconds since last keypress before idle timers trigger. Used for autocompletion, set to 0 for instant. | `400` |
| `completion-trigger-len` | The min-length of word under cursor to trigger autocompletion | `2` |
| `auto-info` | Whether to display infoboxes | `true` |
## LSP

View file

@ -1086,8 +1086,10 @@ impl Component for EditorView {
);
}
if let Some(ref mut info) = self.autoinfo {
info.render(area, surface, cx);
if cx.editor.config.auto_info {
if let Some(ref mut info) = self.autoinfo {
info.render(area, surface, cx);
}
}
let key_width = 15u16; // for showing pending keys

View file

@ -58,6 +58,8 @@ pub struct Config {
#[serde(skip_serializing, deserialize_with = "deserialize_duration_millis")]
pub idle_timeout: Duration,
pub completion_trigger_len: u8,
/// Whether to display infoboxes. Defaults to true.
pub auto_info: bool,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize)]
@ -88,6 +90,7 @@ impl Default for Config {
auto_completion: true,
idle_timeout: Duration::from_millis(400),
completion_trigger_len: 2,
auto_info: true,
}
}
}