diff options
Diffstat (limited to 'pkg/gui/presentation/commit_files.go')
-rw-r--r-- | pkg/gui/presentation/commit_files.go | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/pkg/gui/presentation/commit_files.go b/pkg/gui/presentation/commit_files.go index 4ea0f85db..3f16da965 100644 --- a/pkg/gui/presentation/commit_files.go +++ b/pkg/gui/presentation/commit_files.go @@ -6,21 +6,23 @@ import ( "github.com/jesseduffield/lazygit/pkg/theme" ) -func GetCommitFileListDisplayStrings(branches []*commands.CommitFile) [][]string { - lines := make([][]string, len(branches)) +func GetCommitFileListDisplayStrings(commitFiles []*commands.CommitFile, diffName string) [][]string { + lines := make([][]string, len(commitFiles)) - for i := range branches { - lines[i] = getCommitFileDisplayStrings(branches[i]) + for i := range commitFiles { + diffed := commitFiles[i].Name == diffName + lines[i] = getCommitFileDisplayStrings(commitFiles[i], diffed) } return lines } // getCommitFileDisplayStrings returns the display string of branch -func getCommitFileDisplayStrings(f *commands.CommitFile) []string { +func getCommitFileDisplayStrings(f *commands.CommitFile, diffed bool) []string { yellow := color.New(color.FgYellow) green := color.New(color.FgGreen) defaultColor := color.New(theme.DefaultTextColor) + diffTerminalColor := color.New(theme.DiffTerminalColor) var colour *color.Color switch f.Status { @@ -31,5 +33,8 @@ func getCommitFileDisplayStrings(f *commands.CommitFile) []string { case commands.PART: colour = yellow } + if diffed { + colour = diffTerminalColor + } return []string{colour.Sprint(f.DisplayString)} } |