mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-17 00:18:05 +02:00
better colouring for directories for when adding a patch
This commit is contained in:
@ -8,21 +8,16 @@ import (
|
||||
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||
)
|
||||
|
||||
func GetCommitFileLine(name string, diffName string, commitFile *models.CommitFile, patchManager *patch.PatchManager, parent string) string {
|
||||
func GetCommitFileLine(name string, diffName string, commitFile *models.CommitFile, status patch.PatchStatus) string {
|
||||
yellow := color.New(color.FgYellow)
|
||||
green := color.New(color.FgGreen)
|
||||
defaultColor := color.New(theme.DefaultTextColor)
|
||||
diffTerminalColor := color.New(theme.DiffTerminalColor)
|
||||
|
||||
if commitFile == nil {
|
||||
return name
|
||||
}
|
||||
|
||||
colour := defaultColor
|
||||
if diffName == name {
|
||||
colour = diffTerminalColor
|
||||
} else if commitFile != nil {
|
||||
status := patchManager.GetFileStatus(commitFile.Name, parent)
|
||||
} else {
|
||||
switch status {
|
||||
case patch.UNSELECTED:
|
||||
colour = defaultColor
|
||||
@ -33,6 +28,10 @@ func GetCommitFileLine(name string, diffName string, commitFile *models.CommitFi
|
||||
}
|
||||
}
|
||||
|
||||
if commitFile == nil {
|
||||
return colour.Sprint(name)
|
||||
}
|
||||
|
||||
return utils.ColoredString(commitFile.ChangeStatus, getColorForChangeStatus(commitFile.ChangeStatus)) + " " + colour.Sprint(name)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user