Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix off by 1 error when computing available key bindings

Mikayla0684369734e7
diff --git a/crates/gpui/src/key_dispatch.rs b/crates/gpui/src/key_dispatch.rs
index 22c4dffc03a..81f66746c53 100644
--- a/crates/gpui/src/key_dispatch.rs
+++ b/crates/gpui/src/key_dispatch.rs
@@ -192,8 +192,8 @@ impl DispatchTree {
keymap
.bindings_for_action(action)
.filter(|binding| {
- for i in 1..context_stack.len() {
- let context = &context_stack[0..i];
+ for i in 0..context_stack.len() {
+ let context = &context_stack[0..=i];
if keymap.binding_enabled(binding, context) {
return true;
}