on master help sign in
Manually recalculate initial completion where it matters
commit24f90ba8d8f4a10fb18f71b05c278fe89b71a261 authorBlaž Hrastnik <blaz@mxxn.io> dateThu 17 Feb 2022, 13:56 (5 years ago) parentaf21e2a
2 files changed+7−2
helix-term/src/commands.rs+2 helix-term/src/ui/mod.rs+5−2
helix-term/src/commands.rs+2
@@ -3393,6 +3393,8 @@ fn command_mode(cx: &mut Context) {
33933393 None
33943394 });
33953395
3396+ // Calculate initial completion
3397+ prompt.recalculate_completion(cx.editor);
33963398 cx.push_layer(Box::new(prompt));
33973399}
33983400
helix-term/src/ui/mod.rs+5−2
@@ -38,7 +38,7 @@ pub fn regex_prompt(
3838 let snapshot = doc.selection(view_id).clone();
3939 let offset_snapshot = view.offset;
4040
41− Prompt::new(
41+ let mut prompt = Prompt::new(
4242 prompt,
4343 history_register,
4444 completion_fn,
@@ -91,7 +91,10 @@ pub fn regex_prompt(
9191 }
9292 }
9393 },
94− )
94+ );
95+ // Calculate initial completion
96+ prompt.recalculate_completion(cx.editor);
97+ prompt
9598}
9699
97100pub fn file_picker(root: PathBuf, config: &helix_view::editor::Config) -> FilePicker<PathBuf> {