diff options
author | Blaž Hrastnik | 2021-08-27 01:44:12 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-10-05 13:27:35 +0000 |
commit | 66f26e82ceaf4b81dfeb429dcb840a3242e8f254 (patch) | |
tree | d2346e40e8e1b63c00ea3b2007e2085372f12658 /helix-term/src/application.rs | |
parent | 40abec80e1062503d70055ed9e968cd4b31411a7 (diff) |
Filter the initial completion
Diffstat (limited to 'helix-term/src/application.rs')
-rw-r--r-- | helix-term/src/application.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index ab268041..79921268 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -234,9 +234,8 @@ impl Application { } pub fn handle_idle_timeout(&mut self) { + use crate::commands::{completion, Context}; use helix_view::document::Mode; - use crate::commands::{Context, completion}; - if doc_mut!(self.editor).mode != Mode::Insert { return; @@ -254,6 +253,8 @@ impl Application { return; } + // TODO: if completion window was closed with enter (and no selection) we shouldn't retrigger + let mut cx = Context { selected_register: helix_view::RegisterSelection::default(), editor: &mut self.editor, @@ -262,9 +263,9 @@ impl Application { callback: None, on_next_key_callback: None, }; - completion(&mut cx); - // TODO: scan backwards for trigger and filter the box - self.render(); + completion(&mut cx); + // TODO: scan backwards for trigger and filter the box + self.render(); } pub fn handle_terminal_events(&mut self, event: Option<Result<Event, crossterm::ErrorKind>>) { |