Clear pending keystrokes after dispatching an action
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
0e93bc41dd
commit
3426d46b69
2 changed files with 5 additions and 0 deletions
|
@ -1181,6 +1181,7 @@ impl MutableAppContext {
|
||||||
MatchResult::Action(action) => {
|
MatchResult::Action(action) => {
|
||||||
if self.dispatch_action_any(window_id, &responder_chain[0..=i], action.as_ref())
|
if self.dispatch_action_any(window_id, &responder_chain[0..=i], action.as_ref())
|
||||||
{
|
{
|
||||||
|
self.keystroke_matcher.clear_pending();
|
||||||
return Ok(true);
|
return Ok(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,6 +93,10 @@ impl Matcher {
|
||||||
self.keymap.add_bindings(bindings);
|
self.keymap.add_bindings(bindings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn clear_pending(&mut self) {
|
||||||
|
self.pending.clear();
|
||||||
|
}
|
||||||
|
|
||||||
pub fn push_keystroke(
|
pub fn push_keystroke(
|
||||||
&mut self,
|
&mut self,
|
||||||
keystroke: Keystroke,
|
keystroke: Keystroke,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue