From 03fa959ee82d8f92751f19600434eac513762915 Mon Sep 17 00:00:00 2001 From: A-Walrus Date: Sun, 24 Jul 2022 14:27:03 +0300 Subject: [PATCH] Cleanup code --- helix-term/src/commands.rs | 1 - helix-term/src/ui/mod.rs | 14 ++++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) 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);