diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2024-03-18 20:29:52 +0100 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2024-03-18 20:44:03 +0100 |
commit | 1a9ce9db947d170647b8dcfea2be4172997ff7ed (patch) | |
tree | f7ca3f97c1c6a34fbd6fdeb4c8f6786289153c5a | |
parent | 9a3db0dfbdb16185868b17ffc9075e237665d078 (diff) |
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.)
-rw-r--r-- | pkg/gui/context/commit_message_context.go | 4 | ||||
-rw-r--r-- | pkg/i18n/english.go | 2 | ||||
-rw-r--r-- | pkg/i18n/polish.go | 1 |
3 files changed, 1 insertions, 6 deletions
diff --git a/pkg/gui/context/commit_message_context.go b/pkg/gui/context/commit_message_context.go index 0cea8e6b3..f69b7ef74 100644 --- a/pkg/gui/context/commit_message_context.go +++ b/pkg/gui/context/commit_message_context.go @@ -8,7 +8,6 @@ import ( "github.com/jesseduffield/lazygit/pkg/gui/keybindings" "github.com/jesseduffield/lazygit/pkg/gui/types" "github.com/jesseduffield/lazygit/pkg/utils" - "github.com/samber/lo" ) type CommitMessageContext struct { @@ -112,8 +111,7 @@ func (self *CommitMessageContext) SetPanelState( self.GetView().Title = summaryTitle self.c.Views().CommitDescription.Title = descriptionTitle - subtitleTemplate := lo.Ternary(onSwitchToEditor != nil, self.c.Tr.CommitDescriptionSubTitle, self.c.Tr.CommitDescriptionSubTitleNoSwitch) - self.c.Views().CommitDescription.Subtitle = utils.ResolvePlaceholderString(subtitleTemplate, + self.c.Views().CommitDescription.Subtitle = utils.ResolvePlaceholderString(self.c.Tr.CommitDescriptionSubTitle, map[string]string{ "togglePanelKeyBinding": keybindings.Label(self.c.UserConfig.Keybinding.Universal.TogglePanel), "commitMenuKeybinding": keybindings.Label(self.c.UserConfig.Keybinding.CommitMessage.CommitMenu), diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index 29b78f601..a2a9c1b94 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -272,7 +272,6 @@ type TranslationSet struct { CommitSummaryTitle string CommitDescriptionTitle string CommitDescriptionSubTitle string - CommitDescriptionSubTitleNoSwitch string LocalBranchesTitle string SearchTitle string TagsTitle string @@ -1229,7 +1228,6 @@ func EnglishTranslationSet() TranslationSet { CommitSummaryTitle: "Commit summary", CommitDescriptionTitle: "Commit description", CommitDescriptionSubTitle: "Press {{.togglePanelKeyBinding}} to toggle focus, {{.commitMenuKeybinding}} to open menu", - CommitDescriptionSubTitleNoSwitch: "Press {{.togglePanelKeyBinding}} to toggle focus", LocalBranchesTitle: "Local branches", SearchTitle: "Search", TagsTitle: "Tags", diff --git a/pkg/i18n/polish.go b/pkg/i18n/polish.go index d864af529..f9df0b2e7 100644 --- a/pkg/i18n/polish.go +++ b/pkg/i18n/polish.go @@ -256,7 +256,6 @@ func polishTranslationSet() TranslationSet { CommitSummaryTitle: "Podsumowanie commita", CommitDescriptionTitle: "Opis commita", CommitDescriptionSubTitle: "Naciśnij {{.togglePanelKeyBinding}}, aby przełączyć fokus, {{.commitMenuKeybinding}}, aby otworzyć menu", - CommitDescriptionSubTitleNoSwitch: "Naciśnij {{.togglePanelKeyBinding}}, aby przełączyć fokus", LocalBranchesTitle: "Lokalne gałęzie", SearchTitle: "Szukaj", TagsTitle: "Tagi", |