Fix off by 1 error when computing available key bindings (#3964)

Fixes https://github.com/zed-industries/community/issues/2379

Release Notes:

- Fixed issue where keybindings in some context menus would not show
reliably.
This commit is contained in:
Mikayla Maki 2024-01-08 17:40:43 -08:00 committed by GitHub
commit 6982b4b42e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}