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:
parent
51b4d35dce
commit
cfc8285867
3 changed files with 8 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue