aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui
diff options
context:
space:
mode:
authorBlaž Hrastnik2022-03-22 05:32:06 +0000
committerBlaž Hrastnik2022-03-28 02:02:13 +0000
commit5c162ef995e3822cd465f2c83874a040ebe153b8 (patch)
treeff0a923b235e96d8c677e97fa2690454bc7f16f8 /helix-term/src/ui
parent83b3272166013a7c394fb41dca172042e3229ab4 (diff)
Make regex_prompt directly call cx.push_layer
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r--helix-term/src/ui/mod.rs5
1 files changed, 3 insertions, 2 deletions
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<char>,
completion_fn: impl FnMut(&Editor, &str) -> Vec<prompt::Completion> + '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<PathBuf> {