From 4d12c7c3cf74a9903dc2a72bde19d94e800f505f Mon Sep 17 00:00:00 2001 From: Daichi Takamiya Date: Wed, 2 Jun 2021 10:48:21 +0900 Subject: [PATCH] Fix empty command cause panic --- helix-term/src/commands.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 3dba9333e..6465241f3 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::>(); + if parts.is_empty() { + return; + } if let Some(cmd) = cmd::COMMANDS.get(parts[0]) { (cmd.fun)(editor, &parts[1..], event);