on master help sign in
Make auto-completion a config (#853)
commit89707a858f593c99d44af173e9fb2c0d72b8697e authorIvan Tham <pickfire@riseup.net> dateSat 16 Oct 2021, 21:57 (5 years ago) parent2c0468f
3 files changed+6−2
book/src/configuration.md+1 helix-term/src/application.rs+1−1 helix-view/src/editor.rs+4−1
book/src/configuration.md+1
@@ -19,6 +19,7 @@ To override global configuration parameters, create a `config.toml` file located
1919| `line-number` | Line number display (`absolute`, `relative`) | `absolute` |
2020| `smart-case` | Enable smart case regex searching (case insensitive unless pattern contains upper case characters) | `true` |
2121| `auto-pairs` | Enable automatic insertion of pairs to parenthese, brackets, etc. | `true` |
22+| `auto-completion` | Enable automatic pop up of auto-completion. | `true` |
2223| `idle-timeout` | Time in milliseconds since last keypress before idle timers trigger. Used for autocompletion, set to 0 for instant. | `400` |
2324
2425## LSP
helix-term/src/application.rs+1−1
@@ -238,7 +238,7 @@ impl Application {
238238 use crate::commands::{completion, Context};
239239 use helix_view::document::Mode;
240240
241− if doc_mut!(self.editor).mode != Mode::Insert {
241+ if doc_mut!(self.editor).mode != Mode::Insert || !self.config.editor.auto_completion {
242242 return;
243243 }
244244 let editor_view = self
helix-view/src/editor.rs+4−1
@@ -47,12 +47,14 @@ pub struct Config {
4747 pub shell: Vec<String>,
4848 /// Line number mode.
4949 pub line_number: LineNumber,
50− /// Middle click paste support. Defaults to true
50+ /// Middle click paste support. Defaults to true.
5151 pub middle_click_paste: bool,
5252 /// Smart case: Case insensitive searching unless pattern contains upper case characters. Defaults to true.
5353 pub smart_case: bool,
5454 /// Automatic insertion of pairs to parentheses, brackets, etc. Defaults to true.
5555 pub auto_pairs: bool,
56+ /// Automatic auto-completion, automatically pop up without user trigger. Defaults to true.
57+ pub auto_completion: bool,
5658 /// Time in milliseconds since last keypress before idle timers trigger. Used for autocompletion, set to 0 for instant. Defaults to 400ms.
5759 #[serde(skip_serializing, deserialize_with = "deserialize_duration_millis")]
5860 pub idle_timeout: Duration,
@@ -83,6 +85,7 @@ impl Default for Config {
8385 middle_click_paste: true,
8486 smart_case: true,
8587 auto_pairs: true,
88+ auto_completion: true,
8689 idle_timeout: Duration::from_millis(400),
8790 }
8891 }