Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Add comment explaining push_keystroke
Kay Simmons159d3ab00c49
diff --git a/crates/gpui/src/keymap_matcher.rs b/crates/gpui/src/keymap_matcher.rsindex 93f5d0934af..26da099a9fc 100644--- a/crates/gpui/src/keymap_matcher.rs+++ b/crates/gpui/src/keymap_matcher.rs@@ -60,6 +60,16 @@ impl KeymapMatcher {!self.pending_keystrokes.is_empty()}+ /// Pushes a keystroke onto the matcher.+ /// The result of the new keystroke is returned:+ /// MatchResult::None =>+ /// No match is valid for this key given any pending keystrokes.+ /// MatchResult::Pending =>+ /// There exist bindings which are still waiting for more keys.+ /// MatchResult::Complete(matches) =>+ /// 1 or more bindings have recieved the necessary key presses.+ /// The order of the matched actions is by order in the keymap file first and+ /// position of the matching view second.pub fn push_keystroke(&mut self,keystroke: Keystroke,@@ -117,6 +127,8 @@ impl KeymapMatcher {}if !matched_bindings.is_empty() {+ // Collect the sorted matched bindings into the final vec for ease of use+ // Matched bindings are in order by precedenceMatchResult::Matches(matched_bindings.into_values().flatten().collect())} else if any_pending {MatchResult::Pending