Revert "Use correct context path for focused element in WindowContext::bindings_for_action (#18843)" (#20367)

@JosephTLyons found that this broke display of keybindings in the recent
projects modal.

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2024-11-07 09:45:23 -07:00 committed by GitHub
parent 453c41205b
commit 2c4984091c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 34 additions and 34 deletions

View file

@ -139,7 +139,7 @@ impl Keymap {
pub fn bindings_for_input(
&self,
input: &[Keystroke],
context_path: &[KeyContext],
context_stack: &[KeyContext],
) -> (SmallVec<[KeyBinding; 1]>, bool) {
let possibilities = self.bindings().rev().filter_map(|binding| {
binding
@ -151,8 +151,8 @@ impl Keymap {
let mut is_pending = None;
'outer: for (binding, pending) in possibilities {
for depth in (0..=context_path.len()).rev() {
if self.binding_enabled(binding, &context_path[0..depth]) {
for depth in (0..=context_stack.len()).rev() {
if self.binding_enabled(binding, &context_stack[0..depth]) {
if is_pending.is_none() {
is_pending = Some(pending);
}