Hitting `?` more directly opens the help screen, even when executing a verb
@@ -172,16 +172,16 @@ impl Command {
KeyEvent::PageDown | KeyEvent::Ctrl('d') => {
self.action = Action::ScrollPage(1);
}
- KeyEvent::Char(c) => {
- if c == '?' && self.raw.is_empty() {
- // as first character, a '?' is a request for help
+ KeyEvent::Char(c) if c =='?' && (self.raw.is_empty() || self.parts.verb_invocation.is_some()) => {
+ // a '?' opens the help when it's the first char or when it's part of the verb
+ // invocation
self.action = Action::Help;
- } else {
+ }
+ KeyEvent::Char(c) => {
self.raw.push(c);
self.parts = CommandParts::from(&self.raw);
self.action = Action::from(&self.parts, false);
}
- }
KeyEvent::Esc => {
self.action = Action::Back;
}
