From 83d48f10ea01673c990296c0a5efb5bc201b4972 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Fri, 12 Feb 2021 18:10:05 +0900 Subject: search: Barebones implementation. --- helix-term/src/ui/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'helix-term/src/ui') diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs index 29483705..e1899144 100644 --- a/helix-term/src/ui/mod.rs +++ b/helix-term/src/ui/mod.rs @@ -43,12 +43,15 @@ pub fn regex_prompt( PromptEvent::Update => { match Regex::new(input) { Ok(regex) => { - let doc = &mut editor.view_mut().doc; + let view = &mut editor.view_mut(); + let doc = &mut view.doc; // revert state to what it was before the last update doc.state = snapshot.clone(); fun(doc, regex); + + view.ensure_cursor_in_view(); } Err(_err) => (), // TODO: mark command line as error } -- cgit v1.2.3-70-g09d2