diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/command/panel_input.rs | 2 | ||||
-rw-r--r-- | src/command/parts.rs | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/command/panel_input.rs b/src/command/panel_input.rs index 419447b..879b7fb 100644 --- a/src/command/panel_input.rs +++ b/src/command/panel_input.rs @@ -298,7 +298,7 @@ impl PanelInput { self.input_before_cycle = None; } - if key == keys::ENTER && parts.verb_invocation.is_some() { + if key == keys::ENTER && parts.has_not_empty_verb_invocation() { return Command::from_parts(parts, true); } diff --git a/src/command/parts.rs b/src/command/parts.rs index a82e3ad..b355de5 100644 --- a/src/command/parts.rs +++ b/src/command/parts.rs @@ -26,6 +26,11 @@ impl fmt::Display for CommandParts { } impl CommandParts { + pub fn has_not_empty_verb_invocation(&self) -> bool { + self.verb_invocation + .as_ref() + .map_or(false, |vi| !vi.is_empty()) + } pub fn from(mut raw: String) -> Self { let mut invocation_start_pos: Option<usize> = None; let mut escaping = false; |