1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03: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

@ -848,15 +848,15 @@ func (self *FilesController) openCopyMenu() error {
}
if node == nil {
copyNameItem.DisabledReason = self.c.Tr.NoContentToCopyError
copyPathItem.DisabledReason = self.c.Tr.NoContentToCopyError
copyFileDiffItem.DisabledReason = self.c.Tr.NoContentToCopyError
copyNameItem.DisabledReason = &types.DisabledReason{Text: self.c.Tr.NoContentToCopyError}
copyPathItem.DisabledReason = &types.DisabledReason{Text: self.c.Tr.NoContentToCopyError}
copyFileDiffItem.DisabledReason = &types.DisabledReason{Text: self.c.Tr.NoContentToCopyError}
}
if node != nil && !node.GetHasStagedOrTrackedChanges() {
copyFileDiffItem.DisabledReason = self.c.Tr.NoContentToCopyError
copyFileDiffItem.DisabledReason = &types.DisabledReason{Text: self.c.Tr.NoContentToCopyError}
}
if !self.anyStagedOrTrackedFile() {
copyAllDiff.DisabledReason = self.c.Tr.NoContentToCopyError
copyAllDiff.DisabledReason = &types.DisabledReason{Text: self.c.Tr.NoContentToCopyError}
}
return self.c.Menu(types.CreateMenuOptions{