Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
settings_ui: Open keybinding editing modal on mouse double click (#34193)
Finn Eversd7fd9245cd71
diff --git a/crates/settings_ui/src/keybindings.rs b/crates/settings_ui/src/keybindings.rsindex 9f6992173e9..0e9b6307ae1 100644--- a/crates/settings_ui/src/keybindings.rs+++ b/crates/settings_ui/src/keybindings.rs@@ -10,9 +10,9 @@ use feature_flags::FeatureFlagViewExt;use fs::Fs;use fuzzy::{StringMatch, StringMatchCandidate};use gpui::{- AppContext as _, AsyncApp, Context, DismissEvent, Entity, EventEmitter, FocusHandle, Focusable,- Global, KeyContext, Keystroke, ModifiersChangedEvent, ScrollStrategy, StyledText, Subscription,- WeakEntity, actions, div,+ AppContext as _, AsyncApp, ClickEvent, Context, DismissEvent, Entity, EventEmitter,+ FocusHandle, Focusable, Global, KeyContext, Keystroke, ModifiersChangedEvent, ScrollStrategy,+ StyledText, Subscription, WeakEntity, actions, div,};use language::{Language, LanguageConfig, ToOffset as _};use settings::{BaseKeymap, KeybindSource, KeymapFile, SettingsAssets};@@ -797,9 +797,14 @@ impl Render for KeymapEditor {let row = row.id(("keymap-table-row", row_index))- .on_click(cx.listener(move |this, _event, _window, _cx| {- this.selected_index = Some(row_index);- }))+ .on_click(cx.listener(+ move |this, event: &ClickEvent, window, cx| {+ this.selected_index = Some(row_index);+ if event.up.click_count == 2 {+ this.open_edit_keybinding_modal(false, window, cx);+ }+ },+ )).border_2().when(is_conflict, |row| {row.bg(cx.theme().status().error_background)