Git commit modal command (#26405)
Fix KeyBinding::for_action() to use the active focus handle instead of what was rendered last. This makes the UI consistently chose the cmd-escape binding for close (because escape in the editor is editor::Cancel?), so force it to be "escape" Release Notes: - git: Fixed escape tooltip in commit modal
This commit is contained in:
parent
1f8b14f4f1
commit
4d1d8d6d78
5 changed files with 8 additions and 11 deletions
|
@ -29,6 +29,9 @@ impl KeyBinding {
|
|||
/// Returns the highest precedence keybinding for an action. This is the last binding added to
|
||||
/// the keymap. User bindings are added after built-in bindings so that they take precedence.
|
||||
pub fn for_action(action: &dyn Action, window: &mut Window, cx: &App) -> Option<Self> {
|
||||
if let Some(focused) = window.focused(cx) {
|
||||
return Self::for_action_in(action, &focused, window, cx);
|
||||
}
|
||||
let key_binding =
|
||||
gpui::Keymap::binding_to_display_from_bindings(&window.bindings_for_action(action))
|
||||
.cloned()?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue