diff options
author | Blaž Hrastnik | 2021-03-03 08:55:56 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-03-03 08:55:56 +0000 |
commit | 4c6611f96b6a7d3e27bfb0c8e43d49f62dde493b (patch) | |
tree | 2adf5e8293d37aa3cb41de1b8da9a58dd616d09e /helix-term/src/ui | |
parent | a21d96e7293e32c0d20e8548a65fdd31f92b642d (diff) |
commands: Stop select_regex from breaking when no matches.
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r-- | helix-term/src/ui/mod.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs index 463ac368..593da3ae 100644 --- a/helix-term/src/ui/mod.rs +++ b/helix-term/src/ui/mod.rs @@ -45,6 +45,11 @@ pub fn regex_prompt( // } PromptEvent::Update => { + // skip empty input, TODO: trigger default + if input.is_empty() { + return; + } + match Regex::new(input) { Ok(regex) => { let view = &mut editor.view_mut(); |