on master help sign in
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

commitcfc82858679d264d178a0b072da26828e685de12 authorOmnikar <omnikar5@gmail.com> dateThu 4 Nov 2021, 22:25 (5 years ago) parent51b4d35
3 files changed+8−2
book/src/configuration.md+1 helix-term/src/ui/editor.rs+4−2 helix-view/src/editor.rs+3
book/src/configuration.md+1
@@ -22,6 +22,7 @@ To override global configuration parameters, create a `config.toml` file located
2222| `auto-completion` | Enable automatic pop up of auto-completion. | `true` |
2323| `idle-timeout` | Time in milliseconds since last keypress before idle timers trigger. Used for autocompletion, set to 0 for instant. | `400` |
2424| `completion-trigger-len` | The min-length of word under cursor to trigger autocompletion | `2` |
25+| `auto-info` | Whether to display infoboxes | `true` |
2526
2627## LSP
2728
helix-term/src/ui/editor.rs+4−2
@@ -1086,8 +1086,10 @@ impl Component for EditorView {
10861086 );
10871087 }
10881088
1089− if let Some(ref mut info) = self.autoinfo {
1090− info.render(area, surface, cx);
1089+ if cx.editor.config.auto_info {
1090+ if let Some(ref mut info) = self.autoinfo {
1091+ info.render(area, surface, cx);
1092+ }
10911093 }
10921094
10931095 let key_width = 15u16; // for showing pending keys
helix-view/src/editor.rs+3
@@ -58,6 +58,8 @@ pub struct Config {
5858 #[serde(skip_serializing, deserialize_with = "deserialize_duration_millis")]
5959 pub idle_timeout: Duration,
6060 pub completion_trigger_len: u8,
61+ /// Whether to display infoboxes. Defaults to true.
62+ pub auto_info: bool,
6163}
6264
6365#[derive(Debug, Clone, PartialEq, Eq, Deserialize)]
@@ -88,6 +90,7 @@ impl Default for Config {
8890 auto_completion: true,
8991 idle_timeout: Duration::from_millis(400),
9092 completion_trigger_len: 2,
93+ auto_info: true,
9194 }
9295 }
9396}