Make command dispatching work

This commit is contained in:
Conrad Irwin
2023-11-09 15:14:23 -07:00
parent a1d9f351db
commit fa153a0d56
11 changed files with 188 additions and 118 deletions
-13
View File
@@ -44,19 +44,6 @@ impl KeyBinding {
pending_keystrokes: &[Keystroke],
contexts: &[&DispatchContext],
) -> KeyMatch {
let should_debug = self.keystrokes.len() == 1
&& self.keystrokes[0].key == "p"
&& self.keystrokes[0].modifiers.command == true
&& self.keystrokes[0].modifiers.shift == true;
if false && should_debug {
dbg!(
&self.keystrokes,
&pending_keystrokes,
&contexts,
&self.matches_context(contexts)
);
}
if self.keystrokes.as_ref().starts_with(&pending_keystrokes)
&& self.matches_context(contexts)
{
-1
View File
@@ -46,7 +46,6 @@ impl KeyMatcher {
keystroke: &Keystroke,
context_stack: &[&DispatchContext],
) -> KeyMatch {
dbg!(keystroke, &context_stack);
let keymap = self.keymap.lock();
// Clear pending keystrokes if the keymap has changed since the last matched keystroke.
if keymap.version() != self.keymap_version {