@@ -200,9 +200,9 @@ impl Application {
200 self.render();
200 self.render();
202 _ = &mut self.editor.idle_timer => {
202 _ = &mut self.editor.idle_timer => {
203 self.editor.clear_idle_timer();
204 self.editor.clear_idle_timer();
204− println!("idle!")
205+ self.handle_idle_timeout();
@@ -233,6 +233,40 @@ impl Application {
236+ pub fn handle_idle_timeout(&mut self) {
237+ use helix_view::document::Mode;
238+ use crate::commands::{Context, completion};
241+ if doc_mut!(self.editor).mode != Mode::Insert {
244+ let editor_view = self
246+ .find(std::any::type_name::<ui::EditorView>())
247+ .expect("expected at least one EditorView");
248+ let editor_view = editor_view
250+ .downcast_mut::<ui::EditorView>()
253+ if editor_view.completion.is_some() {
257+ let mut cx = Context {
258+ selected_register: helix_view::RegisterSelection::default(),
259+ editor: &mut self.editor,
260+ jobs: &mut self.jobs,
263+ on_next_key_callback: None,
265+ completion(&mut cx);
266+ // TODO: scan backwards for trigger and filter the box
236 pub fn handle_terminal_events(&mut self, event: Option<Result<Event, crossterm::ErrorKind>>) {
270 pub fn handle_terminal_events(&mut self, event: Option<Result<Event, crossterm::ErrorKind>>) {
237 let mut cx = crate::compositor::Context {
271 let mut cx = crate::compositor::Context {
238 editor: &mut self.editor,
272 editor: &mut self.editor,