mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-15 00:15:32 +02:00
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.)
This commit is contained in:
@ -8,7 +8,6 @@ import (
|
|||||||
"github.com/jesseduffield/lazygit/pkg/gui/keybindings"
|
"github.com/jesseduffield/lazygit/pkg/gui/keybindings"
|
||||||
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
||||||
"github.com/jesseduffield/lazygit/pkg/utils"
|
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||||
"github.com/samber/lo"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type CommitMessageContext struct {
|
type CommitMessageContext struct {
|
||||||
@ -112,8 +111,7 @@ func (self *CommitMessageContext) SetPanelState(
|
|||||||
self.GetView().Title = summaryTitle
|
self.GetView().Title = summaryTitle
|
||||||
self.c.Views().CommitDescription.Title = descriptionTitle
|
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(self.c.Tr.CommitDescriptionSubTitle,
|
||||||
self.c.Views().CommitDescription.Subtitle = utils.ResolvePlaceholderString(subtitleTemplate,
|
|
||||||
map[string]string{
|
map[string]string{
|
||||||
"togglePanelKeyBinding": keybindings.Label(self.c.UserConfig.Keybinding.Universal.TogglePanel),
|
"togglePanelKeyBinding": keybindings.Label(self.c.UserConfig.Keybinding.Universal.TogglePanel),
|
||||||
"commitMenuKeybinding": keybindings.Label(self.c.UserConfig.Keybinding.CommitMessage.CommitMenu),
|
"commitMenuKeybinding": keybindings.Label(self.c.UserConfig.Keybinding.CommitMessage.CommitMenu),
|
||||||
|
@ -272,7 +272,6 @@ type TranslationSet struct {
|
|||||||
CommitSummaryTitle string
|
CommitSummaryTitle string
|
||||||
CommitDescriptionTitle string
|
CommitDescriptionTitle string
|
||||||
CommitDescriptionSubTitle string
|
CommitDescriptionSubTitle string
|
||||||
CommitDescriptionSubTitleNoSwitch string
|
|
||||||
LocalBranchesTitle string
|
LocalBranchesTitle string
|
||||||
SearchTitle string
|
SearchTitle string
|
||||||
TagsTitle string
|
TagsTitle string
|
||||||
@ -1229,7 +1228,6 @@ func EnglishTranslationSet() TranslationSet {
|
|||||||
CommitSummaryTitle: "Commit summary",
|
CommitSummaryTitle: "Commit summary",
|
||||||
CommitDescriptionTitle: "Commit description",
|
CommitDescriptionTitle: "Commit description",
|
||||||
CommitDescriptionSubTitle: "Press {{.togglePanelKeyBinding}} to toggle focus, {{.commitMenuKeybinding}} to open menu",
|
CommitDescriptionSubTitle: "Press {{.togglePanelKeyBinding}} to toggle focus, {{.commitMenuKeybinding}} to open menu",
|
||||||
CommitDescriptionSubTitleNoSwitch: "Press {{.togglePanelKeyBinding}} to toggle focus",
|
|
||||||
LocalBranchesTitle: "Local branches",
|
LocalBranchesTitle: "Local branches",
|
||||||
SearchTitle: "Search",
|
SearchTitle: "Search",
|
||||||
TagsTitle: "Tags",
|
TagsTitle: "Tags",
|
||||||
|
@ -256,7 +256,6 @@ func polishTranslationSet() TranslationSet {
|
|||||||
CommitSummaryTitle: "Podsumowanie commita",
|
CommitSummaryTitle: "Podsumowanie commita",
|
||||||
CommitDescriptionTitle: "Opis commita",
|
CommitDescriptionTitle: "Opis commita",
|
||||||
CommitDescriptionSubTitle: "Naciśnij {{.togglePanelKeyBinding}}, aby przełączyć fokus, {{.commitMenuKeybinding}}, aby otworzyć menu",
|
CommitDescriptionSubTitle: "Naciśnij {{.togglePanelKeyBinding}}, aby przełączyć fokus, {{.commitMenuKeybinding}}, aby otworzyć menu",
|
||||||
CommitDescriptionSubTitleNoSwitch: "Naciśnij {{.togglePanelKeyBinding}}, aby przełączyć fokus",
|
|
||||||
LocalBranchesTitle: "Lokalne gałęzie",
|
LocalBranchesTitle: "Lokalne gałęzie",
|
||||||
SearchTitle: "Szukaj",
|
SearchTitle: "Szukaj",
|
||||||
TagsTitle: "Tagi",
|
TagsTitle: "Tagi",
|
||||||
|
Reference in New Issue
Block a user