diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 762839bad5967..ed85b03f90653 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -3622,6 +3622,18 @@ fn remove_primary_selection(cx: &mut Context) { } pub fn completion(cx: &mut Context) { + // TODO completion starts to get ugly... + // maybe think about something like completion provider and separate completion-state into helix-view? + let clear_completion = async move { + let call: job::Callback = + Box::new(move |editor: &mut Editor, compositor: &mut Compositor| { + let ui = compositor.find::().unwrap(); + ui.clear_completion(editor); + }); + Ok(call) + }; + cx.jobs.callback(clear_completion); + use helix_lsp::{lsp, util::pos_to_lsp_pos}; let (view, doc) = current!(cx.editor);