diff options
author | A-Walrus | 2022-10-03 14:43:26 +0000 |
---|---|---|
committer | GitHub | 2022-10-03 14:43:26 +0000 |
commit | f3958aa1fd4518aad0842e3015d991aadce1fd28 (patch) | |
tree | 519b79d2bbeac5eabb626d86f49c3ee68d6c02b8 /helix-term/src/ui/mod.rs | |
parent | 2fac9e24e565e976a8af8d82a4b6f2755a82a074 (diff) |
Cycled to end/beginning + no more matches msgs (#3176)
* Show status msg when next/prev cycles around
* Add msg when there is no wraparound
* Cleanup code
* Change msg to "Wrapped around document"
Diffstat (limited to 'helix-term/src/ui/mod.rs')
-rw-r--r-- | helix-term/src/ui/mod.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs index ba809d9b..8ab15bff 100644 --- a/helix-term/src/ui/mod.rs +++ b/helix-term/src/ui/mod.rs @@ -26,7 +26,7 @@ pub use text::Text; use helix_core::regex::Regex; use helix_core::regex::RegexBuilder; -use helix_view::{Document, Editor, View}; +use helix_view::Editor; use std::path::PathBuf; @@ -61,7 +61,7 @@ pub fn regex_prompt( prompt: std::borrow::Cow<'static, str>, history_register: Option<char>, completion_fn: impl FnMut(&Editor, &str) -> Vec<prompt::Completion> + 'static, - fun: impl Fn(&mut View, &mut Document, Regex, PromptEvent) + 'static, + fun: impl Fn(&mut Editor, Regex, PromptEvent) + 'static, ) { let (view, doc) = current!(cx.editor); let doc_id = view.doc; @@ -108,8 +108,9 @@ pub fn regex_prompt( view.jumps.push((doc_id, snapshot.clone())); } - fun(view, doc, regex, event); + fun(cx.editor, regex, event); + let (view, doc) = current!(cx.editor); view.ensure_cursor_in_view(doc, config.scrolloff); } Err(err) => { |