Skip to content

Commit 1a9ce9d

Browse files
committed
Always show the "Press <c-o> to open menu" help text in the commit panel
Previously we would hide it if no onSwitchToEditor function was set; that was from a time when <c-o> was bound directly to the switch-to-editor command. Now it is bound to showing a menu, and that menu is always available even if no onSwitchToEditor function is set. (We rather need to disable the switch to editor item _within_ that menu, see next commit.)
1 parent 9a3db0d commit 1a9ce9d

File tree

3 files changed

+1
-6
lines changed

3 files changed

+1
-6
lines changed

pkg/gui/context/commit_message_context.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/jesseduffield/lazygit/pkg/gui/keybindings"
99
"github.com/jesseduffield/lazygit/pkg/gui/types"
1010
"github.com/jesseduffield/lazygit/pkg/utils"
11-
"github.com/samber/lo"
1211
)
1312

1413
type CommitMessageContext struct {
@@ -112,8 +111,7 @@ func (self *CommitMessageContext) SetPanelState(
112111
self.GetView().Title = summaryTitle
113112
self.c.Views().CommitDescription.Title = descriptionTitle
114113

115-
subtitleTemplate := lo.Ternary(onSwitchToEditor != nil, self.c.Tr.CommitDescriptionSubTitle, self.c.Tr.CommitDescriptionSubTitleNoSwitch)
116-
self.c.Views().CommitDescription.Subtitle = utils.ResolvePlaceholderString(subtitleTemplate,
114+
self.c.Views().CommitDescription.Subtitle = utils.ResolvePlaceholderString(self.c.Tr.CommitDescriptionSubTitle,
117115
map[string]string{
118116
"togglePanelKeyBinding": keybindings.Label(self.c.UserConfig.Keybinding.Universal.TogglePanel),
119117
"commitMenuKeybinding": keybindings.Label(self.c.UserConfig.Keybinding.CommitMessage.CommitMenu),

pkg/i18n/english.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ type TranslationSet struct {
272272
CommitSummaryTitle string
273273
CommitDescriptionTitle string
274274
CommitDescriptionSubTitle string
275-
CommitDescriptionSubTitleNoSwitch string
276275
LocalBranchesTitle string
277276
SearchTitle string
278277
TagsTitle string
@@ -1229,7 +1228,6 @@ func EnglishTranslationSet() TranslationSet {
12291228
CommitSummaryTitle: "Commit summary",
12301229
CommitDescriptionTitle: "Commit description",
12311230
CommitDescriptionSubTitle: "Press {{.togglePanelKeyBinding}} to toggle focus, {{.commitMenuKeybinding}} to open menu",
1232-
CommitDescriptionSubTitleNoSwitch: "Press {{.togglePanelKeyBinding}} to toggle focus",
12331231
LocalBranchesTitle: "Local branches",
12341232
SearchTitle: "Search",
12351233
TagsTitle: "Tags",

pkg/i18n/polish.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ func polishTranslationSet() TranslationSet {
256256
CommitSummaryTitle: "Podsumowanie commita",
257257
CommitDescriptionTitle: "Opis commita",
258258
CommitDescriptionSubTitle: "Naciśnij {{.togglePanelKeyBinding}}, aby przełączyć fokus, {{.commitMenuKeybinding}}, aby otworzyć menu",
259-
CommitDescriptionSubTitleNoSwitch: "Naciśnij {{.togglePanelKeyBinding}}, aby przełączyć fokus",
260259
LocalBranchesTitle: "Lokalne gałęzie",
261260
SearchTitle: "Szukaj",
262261
TagsTitle: "Tagi",

0 commit comments

Comments
 (0)