Fix bug where `:h` would leave pending keys

Using `:h` with a key that branches into other bindings, such as `g` or
`z` would leave the inputted keys as pending, meaning that any following
keypresses would register as if the looked-up keys had been typed first.
pull/997/head
Omnikar 1 year ago
parent 7f3a49ecc0
commit 9db0321bff
No known key found for this signature in database
GPG Key ID: 7DE6694CDA7885ED

@ -2490,9 +2490,13 @@ fn help(cx: &mut compositor::Context, args: &[Cow<str>], event: PromptEvent) ->
KeymapResult::NotFound | KeymapResult::Cancelled(_) => { KeymapResult::NotFound | KeymapResult::Cancelled(_) => {
Err(anyhow!("No command found for '{}'", arg)) Err(anyhow!("No command found for '{}'", arg))
} }
KeymapResult::Pending(_) => Err(anyhow!( KeymapResult::Pending(_) => {
// Clear pending keys
keymaps.get(mode, crate::keymap::macros::key!(Esc));
Err(anyhow!(
"`:help` for branching keybinds is not yet supported." "`:help` for branching keybinds is not yet supported."
)), ))
}
KeymapResult::MatchedSequence(_) => Err(anyhow!( KeymapResult::MatchedSequence(_) => Err(anyhow!(
"`:help` for sequence bindings is not yet supported." "`:help` for sequence bindings is not yet supported."
)), )),

Loading…
Cancel
Save