From 5c162ef995e3822cd465f2c83874a040ebe153b8 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Tue, 22 Mar 2022 14:32:06 +0900 Subject: Make regex_prompt directly call cx.push_layer --- helix-term/src/ui/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'helix-term/src/ui') diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs index 6242ea2e..3c39a517 100644 --- a/helix-term/src/ui/mod.rs +++ b/helix-term/src/ui/mod.rs @@ -32,7 +32,7 @@ pub fn regex_prompt( history_register: Option, completion_fn: impl FnMut(&Editor, &str) -> Vec + 'static, fun: impl Fn(&mut View, &mut Document, Regex, PromptEvent) + 'static, -) -> Prompt { +) { let (view, doc) = current!(cx.editor); let doc_id = view.doc; let snapshot = doc.selection(view.id).clone(); @@ -95,7 +95,8 @@ pub fn regex_prompt( ); // Calculate initial completion prompt.recalculate_completion(cx.editor); - prompt + // prompt + cx.push_layer(Box::new(prompt)); } pub fn file_picker(root: PathBuf, config: &helix_view::editor::Config) -> FilePicker { -- cgit v1.2.3-70-g09d2