on master help sign in
Manually recalculate initial completion where it matters
24f90baBlaž Hrastnik
helix-term/src/commands.rs+2
@@ -3393,6 +3393,8 @@ fn command_mode(cx: &mut Context) {
3393 None
3393 None
3394 });
3394 });
3395
3395
3396+ // Calculate initial completion
3397+ prompt.recalculate_completion(cx.editor);
3396 cx.push_layer(Box::new(prompt));
3398 cx.push_layer(Box::new(prompt));
3397}
3399}
3398
3400
helix-term/src/ui/mod.rs+5−2
@@ -38,7 +38,7 @@ pub fn regex_prompt(
38 let snapshot = doc.selection(view_id).clone();
38 let snapshot = doc.selection(view_id).clone();
39 let offset_snapshot = view.offset;
39 let offset_snapshot = view.offset;
40
40
41− Prompt::new(
41+ let mut prompt = Prompt::new(
42 prompt,
42 prompt,
43 history_register,
43 history_register,
44 completion_fn,
44 completion_fn,
@@ -91,7 +91,10 @@ pub fn regex_prompt(
91 }
91 }
92 }
92 }
93 },
93 },
94− )
94+ );
95+ // Calculate initial completion
96+ prompt.recalculate_completion(cx.editor);
97+ prompt
95}
98}
96
99
97pub fn file_picker(root: PathBuf, config: &helix_view::editor::Config) -> FilePicker<PathBuf> {
100pub fn file_picker(root: PathBuf, config: &helix_view::editor::Config) -> FilePicker<PathBuf> {