1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-29 22:48:24 +02:00

Make DisabledReason a struct

This is a pure refactoring, no change in behavior yet. We'll add another field
to the struct in the next commit.
This commit is contained in:
Stefan Haller
2024-01-13 20:02:10 +01:00
parent 09a24ee97d
commit 84e1d15079
10 changed files with 73 additions and 69 deletions

View File

@@ -378,11 +378,11 @@ func (self *ConfirmationHelper) IsPopupPanelFocused() bool {
func (self *ConfirmationHelper) TooltipForMenuItem(menuItem *types.MenuItem) string {
tooltip := menuItem.Tooltip
if menuItem.DisabledReason != "" {
if menuItem.DisabledReason != nil {
if tooltip != "" {
tooltip += "\n\n"
}
tooltip += style.FgRed.Sprintf(self.c.Tr.DisabledMenuItemPrefix) + menuItem.DisabledReason
tooltip += style.FgRed.Sprintf(self.c.Tr.DisabledMenuItemPrefix) + menuItem.DisabledReason.Text
}
return tooltip
}