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
pull/984/head
Omnikar 3 years ago committed by GitHub
parent 51b4d35dce
commit cfc8285867
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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` | | `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` | | `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` | | `completion-trigger-len` | The min-length of word under cursor to trigger autocompletion | `2` |
| `auto-info` | Whether to display infoboxes | `true` |
## LSP ## LSP

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

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

Loading…
Cancel
Save