Allow opening settings.json file from Settings UI with keybinding (#43747)

Release Notes:

- Added a keybinding to open the `settings.json` file when the Settings
UI is in focus: `cmd-,` (macOS) / `ctrl-,` (Windows / Linux).
- A tooltip was added to the `Edit in settings.json` button to show this
keybinding.
This commit is contained in:
Joseph T. Lyons
2025-11-28 18:34:52 +00:00
committed by GitHub
parent 6c98003ffb
commit f6ab73033a
4 changed files with 18 additions and 0 deletions
+1
View File
@@ -1279,6 +1279,7 @@
"escape": "workspace::CloseWindow",
"ctrl-m": "settings_editor::Minimize",
"ctrl-f": "search::FocusSearch",
"ctrl-,": "settings_editor::OpenCurrentFile",
"left": "settings_editor::ToggleFocusNav",
"ctrl-shift-e": "settings_editor::ToggleFocusNav",
// todo(settings_ui): cut this down based on the max files and overflow UI
+1
View File
@@ -1382,6 +1382,7 @@
"escape": "workspace::CloseWindow",
"cmd-m": "settings_editor::Minimize",
"cmd-f": "search::FocusSearch",
"cmd-,": "settings_editor::OpenCurrentFile",
"left": "settings_editor::ToggleFocusNav",
"cmd-shift-e": "settings_editor::ToggleFocusNav",
// todo(settings_ui): cut this down based on the max files and overflow UI
+1
View File
@@ -1305,6 +1305,7 @@
"escape": "workspace::CloseWindow",
"ctrl-m": "settings_editor::Minimize",
"ctrl-f": "search::FocusSearch",
"ctrl-,": "settings_editor::OpenCurrentFile",
"left": "settings_editor::ToggleFocusNav",
"ctrl-shift-e": "settings_editor::ToggleFocusNav",
// todo(settings_ui): cut this down based on the max files and overflow UI
+15
View File
@@ -419,6 +419,11 @@ fn init_renderers(cx: &mut App) {
.style(ButtonStyle::Outlined)
.size(ButtonSize::Medium)
.tab_index(0_isize)
.tooltip(Tooltip::for_action_title_in(
"Edit in settings.json",
&OpenCurrentFile,
&settings_window.focus_handle,
))
.on_click(cx.listener(|this, _, window, cx| {
this.open_current_settings_file(window, cx);
}))
@@ -2172,6 +2177,11 @@ impl SettingsWindow {
Button::new(edit_in_json_id, "Edit in settings.json")
.tab_index(0_isize)
.style(ButtonStyle::OutlinedGhost)
.tooltip(Tooltip::for_action_title_in(
"Edit in settings.json",
&OpenCurrentFile,
&self.focus_handle,
))
.on_click(cx.listener(|this, _, window, cx| {
this.open_current_settings_file(window, cx);
})),
@@ -2865,6 +2875,11 @@ impl SettingsWindow {
Button::new("open-in-settings-file", "Edit in settings.json")
.tab_index(0_isize)
.style(ButtonStyle::OutlinedGhost)
.tooltip(Tooltip::for_action_title_in(
"Edit in settings.json",
&OpenCurrentFile,
&self.focus_handle,
))
.on_click(cx.listener(|this, _, window, cx| {
this.open_current_settings_file(window, cx);
})),