Skip to content

Commit

Permalink
Cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
A-Walrus committed Jul 24, 2022
1 parent 6ebc3c1 commit 03fa959
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
1 change: 0 additions & 1 deletion helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 6 additions & 8 deletions helix-term/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 03fa959

Please sign in to comment.