@@ -187,17 +187,13 @@ impl Application {
189 fn render(&mut self) {
189 fn render(&mut self) {
190− let editor = &mut self.editor;
191− let compositor = &mut self.compositor;
192− let jobs = &mut self.jobs;
194 let mut cx = crate::compositor::Context {
190 let mut cx = crate::compositor::Context {
195− editor,
191+ editor: &mut self.editor,
196− jobs,
192+ jobs: &mut self.jobs,
197 scroll: None,
193 scroll: None,
200− compositor.render(&mut cx);
196+ self.compositor.render(&mut cx);
203 pub async fn event_loop(&mut self) {
199 pub async fn event_loop(&mut self) {
@@ -278,31 +274,20 @@ impl Application {
280 pub fn handle_idle_timeout(&mut self) {
276 pub fn handle_idle_timeout(&mut self) {
281− use crate::commands::{insert::idle_completion, Context};
277+ use crate::compositor::EventResult;
282− use helix_view::document::Mode;
284− if doc!(self.editor).mode != Mode::Insert || !self.config.editor.auto_completion {
287 let editor_view = self
278 let editor_view = self
288 .compositor
279 .compositor
289 .find::<ui::EditorView>()
280 .find::<ui::EditorView>()
290 .expect("expected at least one EditorView");
281 .expect("expected at least one EditorView");
292− if editor_view.completion.is_some() {
296− let mut cx = Context {
283+ let mut cx = crate::compositor::Context {
298 editor: &mut self.editor,
284 editor: &mut self.editor,
299 jobs: &mut self.jobs,
285 jobs: &mut self.jobs,
300− count: None,
286+ scroll: None,
302− on_next_key_callback: None,
304− idle_completion(&mut cx);
288+ if let EventResult::Consumed(_) = editor_view.handle_idle_timeout(&mut cx) {
305− self.render();
289+ self.render();
308 pub fn handle_terminal_events(&mut self, event: Option<Result<Event, crossterm::ErrorKind>>) {
293 pub fn handle_terminal_events(&mut self, event: Option<Result<Event, crossterm::ErrorKind>>) {