aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui
diff options
context:
space:
mode:
authorGokul Soumya2022-10-11 00:10:01 +0000
committerGitHub2022-10-11 00:10:01 +0000
commit001858b11fb60926725e061ec31dfa9c77562148 (patch)
tree810b288609044d09044e65d30a26e3390f6d0d27 /helix-term/src/ui
parent5e1c589d43ee92412a97bfb0dd3d5b333eac4971 (diff)
Propagate idle timeout event to components (#3172)
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r--helix-term/src/ui/editor.rs13
1 files changed, 3 insertions, 10 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index 47fb7a4a..18e1271f 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -1066,7 +1066,7 @@ impl EditorView {
editor.clear_idle_timer(); // don't retrigger
}
- pub fn handle_idle_timeout(&mut self, cx: &mut crate::compositor::Context) -> EventResult {
+ pub fn handle_idle_timeout(&mut self, cx: &mut commands::Context) -> EventResult {
if self.completion.is_some()
|| cx.editor.mode != Mode::Insert
|| !cx.editor.config().auto_completion
@@ -1074,15 +1074,7 @@ impl EditorView {
return EventResult::Ignored(None);
}
- let mut cx = commands::Context {
- register: None,
- editor: cx.editor,
- jobs: cx.jobs,
- count: None,
- callback: None,
- on_next_key_callback: None,
- };
- crate::commands::insert::idle_completion(&mut cx);
+ crate::commands::insert::idle_completion(cx);
EventResult::Consumed(None)
}
@@ -1403,6 +1395,7 @@ impl Component for EditorView {
}
Event::Mouse(event) => self.handle_mouse_event(event, &mut cx),
+ Event::IdleTimeout => self.handle_idle_timeout(&mut cx),
Event::FocusGained | Event::FocusLost => EventResult::Ignored(None),
}
}