diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index d8e68e00cef0..24edc2549c67 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1549,7 +1549,6 @@ fn split_selection_on_newline(cx: &mut Context) { doc.set_selection(view.id, selection); } -// #[allow(clippy::too_many_arguments)] fn search_impl( editor: &mut Editor, contents: &str, diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs index 02140b8ac285..ada629048ef2 100644 --- a/helix-term/src/ui/mod.rs +++ b/helix-term/src/ui/mod.rs @@ -103,16 +103,14 @@ pub fn regex_prompt( .build() { Ok(regex) => { - { - let (view, doc) = current!(cx.editor); + let (view, doc) = current!(cx.editor); - // revert state to what it was before the last update - doc.set_selection(view.id, snapshot.clone()); + // revert state to what it was before the last update + doc.set_selection(view.id, snapshot.clone()); - if event == PromptEvent::Validate { - // Equivalent to push_jump to store selection just before jump - view.jumps.push((doc_id, snapshot.clone())); - } + if event == PromptEvent::Validate { + // Equivalent to push_jump to store selection just before jump + view.jumps.push((doc_id, snapshot.clone())); } fun(cx.editor, regex, event);