diff --git a/docs/reference/keyboard-shortcuts.mdx b/docs/reference/keyboard-shortcuts.mdx index cb233367..7bae2e82 100644 --- a/docs/reference/keyboard-shortcuts.mdx +++ b/docs/reference/keyboard-shortcuts.mdx @@ -113,7 +113,7 @@ Keybindings**: | Panels | `ShowRightPanelInfo` · `ShowRightPanelChanges` · `ShowRightPanelFiles` | | Document | `ToggleDocumentFill` · `DocumentWidthThird` · `DocumentWidthHalf` · `DocumentWidthTwoThirds` | | SSH | `ToggleSftp` · `ShowSshForwards` · `OpenSshProfiles` | -| Application | `About` · `CheckForUpdates` · `OpenDocumentation` · `OpenDiscord` · `ReportIssue` · `ShowAll` · `ZoomWindow` | +| Application | `About` · `CheckForUpdates` · `OpenDocumentation` · `OpenDiscord` · `ReportIssue` · `ShowAll` · `ZoomWindow` · `RestartDaemon` | ## Rebinding syntax diff --git a/src/ui/keymap.rs b/src/ui/keymap.rs index 9e3bde13..4c24580b 100644 --- a/src/ui/keymap.rs +++ b/src/ui/keymap.rs @@ -465,6 +465,11 @@ pub(crate) fn default_bindings() -> Vec<(&'static str, &'static str)> { // Deliberately unbound. Docking is the default and Esc already gets the // terminal back, so a default chord here would only be one more thing // competing for a two-key combination nobody asked for. + // Bindable with no default chord, like the rest of this run. It is + // reachable from the app menu and the palette; leaving it out of + // this table was the one thing that made it the only menu item of + // forty-five a user could not put a key on. + ("RestartDaemon", ""), ("ToggleDocumentFill", ""), ("DocumentWidthThird", ""), ("DocumentWidthHalf", ""), @@ -654,6 +659,10 @@ fn authored_entry(action: &str) -> Option<(CommandGroup, String)> { t(L10nKey::AppMenuRightPanel).to_string(), ), "ToggleCodePanel" => (CommandGroup::View, t(L10nKey::AppMenuCodePanel).to_string()), + "RestartDaemon" => ( + CommandGroup::Application, + t(L10nKey::CmdRestartServer).to_string(), + ), "ToggleDocumentFill" => ( CommandGroup::View, t(L10nKey::CmdToggleDocumentFill).to_string(), @@ -1228,6 +1237,7 @@ fn make_binding(action: &str, keystroke: &str) -> Option { "ToggleSftp" => KeyBinding::new(keystroke, ToggleSftp, None), "ShowSshForwards" => KeyBinding::new(keystroke, ShowSshForwards, None), "ToggleCodePanel" => KeyBinding::new(keystroke, ToggleCodePanel, None), + "RestartDaemon" => KeyBinding::new(keystroke, RestartDaemon, None), "ToggleDocumentFill" => KeyBinding::new(keystroke, ToggleDocumentFill, None), "DocumentWidthThird" => KeyBinding::new(keystroke, DocumentWidthThird, None), "DocumentWidthHalf" => KeyBinding::new(keystroke, DocumentWidthHalf, None), diff --git a/src/ui/palette.rs b/src/ui/palette.rs index 350e4526..165202bd 100644 --- a/src/ui/palette.rs +++ b/src/ui/palette.rs @@ -302,6 +302,7 @@ impl CommandKind { ScmCommitAmend => "ScmCommitAmend", ScmRefresh => "ScmRefresh", ScmToggleGraph => "ScmToggleGraph", + RestartDaemon => "RestartDaemon", ScmPull => "ScmPull", ScmFetch => "ScmFetch", ScmSync => "ScmSync", @@ -309,12 +310,6 @@ impl CommandKind { OpenBranchPicker => "ScmCheckoutBranch", ToggleDiffViewMode => "ToggleDiffViewMode", // No keymap action of their own, so there is no shortcut to show. - // `RestartDaemon` is here rather than above because it named - // `"RestartDaemon"`, which the keymap has never bound: the lookup - // could only ever come back empty, and naming an action that does - // not exist reads like one that does. Restarting the server is - // palette-only for now; giving it a bindable action means a gpui - // action and a handler, which is a feature rather than a fix. CopyText | CutText | PasteText @@ -325,7 +320,6 @@ impl CommandKind { | OpenThemePicker | OpenSshConnectInput | OpenSshConnect(_) - | RestartDaemon | SetTheme(_) | ActivateTab(_) | ConnectSavedProfile(_)