diff options
Diffstat (limited to 'pkg/gui/presentation/reflog_commits.go')
-rw-r--r-- | pkg/gui/presentation/reflog_commits.go | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/pkg/gui/presentation/reflog_commits.go b/pkg/gui/presentation/reflog_commits.go index e57560b76..cf3765b1c 100644 --- a/pkg/gui/presentation/reflog_commits.go +++ b/pkg/gui/presentation/reflog_commits.go @@ -7,10 +7,10 @@ import ( "github.com/jesseduffield/lazygit/pkg/utils" ) -func GetReflogCommitListDisplayStrings(commits []*commands.Commit, fullDescription bool) [][]string { +func GetReflogCommitListDisplayStrings(commits []*commands.Commit, fullDescription bool, diffName string) [][]string { lines := make([][]string, len(commits)) - var displayFunc func(*commands.Commit) []string + var displayFunc func(*commands.Commit, bool) []string if fullDescription { displayFunc = getFullDescriptionDisplayStringsForReflogCommit } else { @@ -18,23 +18,27 @@ func GetReflogCommitListDisplayStrings(commits []*commands.Commit, fullDescripti } for i := range commits { - lines[i] = displayFunc(commits[i]) + diffed := commits[i].Sha == diffName + lines[i] = displayFunc(commits[i], diffed) } return lines } -func getFullDescriptionDisplayStringsForReflogCommit(c *commands.Commit) []string { - defaultColor := color.New(theme.DefaultTextColor) +func getFullDescriptionDisplayStringsForReflogCommit(c *commands.Commit, diffed bool) []string { + colorAttr := theme.DefaultTextColor + if diffed { + colorAttr = theme.DiffTerminalColor + } return []string{ utils.ColoredString(c.ShortSha(), color.FgBlue), utils.ColoredString(utils.UnixToDate(c.UnixTimestamp), color.FgMagenta), - defaultColor.Sprint(c.Name), + utils.ColoredString(c.Name, colorAttr), } } -func getDisplayStringsForReflogCommit(c *commands.Commit) []string { +func getDisplayStringsForReflogCommit(c *commands.Commit, diffed bool) []string { defaultColor := color.New(theme.DefaultTextColor) return []string{utils.ColoredString(c.ShortSha(), color.FgBlue), defaultColor.Sprint(c.Name)} |