1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-10-29 15:09:22 +03:00

Don't append "Disabled: " to menu tooltip if disabled reason is empty

In some cases we set a disabled reason but leave the text empty, so that we
don't get an error toast when the item is invoked. In such a case it looks
awkward if there is a tooltip showing "Disabled: " with no following text.
This commit is contained in:
Stefan Haller
2025-08-13 08:45:50 +02:00
parent 0c0c32aec4
commit da7121fa87

View File

@@ -348,7 +348,7 @@ func (self *ConfirmationHelper) IsPopupPanelFocused() bool {
func (self *ConfirmationHelper) TooltipForMenuItem(menuItem *types.MenuItem) string {
tooltip := menuItem.Tooltip
if menuItem.DisabledReason != nil {
if menuItem.DisabledReason != nil && menuItem.DisabledReason.Text != "" {
if tooltip != "" {
tooltip += "\n\n"
}