diff options
author | Blaž Hrastnik | 2022-06-06 15:08:47 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2022-06-06 15:23:40 +0000 |
commit | b14c258a2c447b892c89d3e68ef4c9a74effca85 (patch) | |
tree | 0e88e735936e48c2c82e4525fc957b3548995777 /helix-term/src/commands.rs | |
parent | 8351a82c2cae58dd49c654d0e878c9d7227ef9c8 (diff) |
prompt: If submitting empty prompt, use default (last used)
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r-- | helix-term/src/commands.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index e7efa6c3..e2ef8f2a 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1488,7 +1488,7 @@ fn select_regex(cx: &mut Context) { Some(reg), ui::completers::none, move |view, doc, regex, event| { - if event != PromptEvent::Update { + if !matches!(event, PromptEvent::Update | PromptEvent::Validate) { return; } let text = doc.text().slice(..); @@ -1509,7 +1509,7 @@ fn split_selection(cx: &mut Context) { Some(reg), ui::completers::none, move |view, doc, regex, event| { - if event != PromptEvent::Update { + if !matches!(event, PromptEvent::Update | PromptEvent::Validate) { return; } let text = doc.text().slice(..); @@ -1657,7 +1657,7 @@ fn searcher(cx: &mut Context, direction: Direction) { .collect() }, move |view, doc, regex, event| { - if event != PromptEvent::Update { + if !matches!(event, PromptEvent::Update | PromptEvent::Validate) { return; } search_impl( @@ -3563,7 +3563,7 @@ fn keep_or_remove_selections_impl(cx: &mut Context, remove: bool) { Some(reg), ui::completers::none, move |view, doc, regex, event| { - if event != PromptEvent::Update { + if !matches!(event, PromptEvent::Update | PromptEvent::Validate) { return; } let text = doc.text().slice(..); |