aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
authorDaichi Takamiya2021-06-02 01:48:21 +0000
committerDaichi Takamiya2021-06-02 01:55:32 +0000
commit4d12c7c3cf74a9903dc2a72bde19d94e800f505f (patch)
tree6287dc3d901a68af1eda7cd6312ff8e5e2984154 /helix-term/src
parentdbc392d92c8201e221867b0d29997da3577d3622 (diff)
Fix empty command cause panic
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/commands.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 3dba9333..6465241f 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -1031,6 +1031,9 @@ pub fn command_mode(cx: &mut Context) {
}
let parts = input.split_ascii_whitespace().collect::<Vec<&str>>();
+ if parts.is_empty() {
+ return;
+ }
if let Some(cmd) = cmd::COMMANDS.get(parts[0]) {
(cmd.fun)(editor, &parts[1..], event);