1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-10-08 22:52:12 +02:00

Show commit mark before showing extra info (#2928)

This commit is contained in:
Jesse Duffield
2023-08-12 16:44:27 +10:00
committed by GitHub

View File

@@ -341,16 +341,17 @@ func displayCommit(
name = emoji.Sprint(name) name = emoji.Sprint(name)
} }
mark := ""
if isYouAreHereCommit { if isYouAreHereCommit {
color := lo.Ternary(commit.Action == models.ActionConflict, style.FgRed, style.FgYellow) color := lo.Ternary(commit.Action == models.ActionConflict, style.FgRed, style.FgYellow)
youAreHere := color.Sprintf("<-- %s ---", common.Tr.YouAreHere) youAreHere := color.Sprintf("<-- %s ---", common.Tr.YouAreHere)
name = fmt.Sprintf("%s %s", youAreHere, name) mark = fmt.Sprintf("%s ", youAreHere)
} else if isMarkedBaseCommit { } else if isMarkedBaseCommit {
rebaseFromHere := style.FgYellow.Sprint(common.Tr.MarkedCommitMarker) rebaseFromHere := style.FgYellow.Sprint(common.Tr.MarkedCommitMarker)
name = fmt.Sprintf("%s %s", rebaseFromHere, name) mark = fmt.Sprintf("%s ", rebaseFromHere)
} else if !willBeRebased { } else if !willBeRebased {
willBeRebased := style.FgYellow.Sprint("✓") willBeRebased := style.FgYellow.Sprint("✓")
name = fmt.Sprintf("%s %s", willBeRebased, name) mark = fmt.Sprintf("%s ", willBeRebased)
} }
authorFunc := authors.ShortAuthor authorFunc := authors.ShortAuthor
@@ -373,7 +374,7 @@ func displayCommit(
cols, cols,
actionString, actionString,
authorFunc(commit.AuthorName), authorFunc(commit.AuthorName),
graphLine+tagString+theme.DefaultTextColor.Sprint(name), graphLine+mark+tagString+theme.DefaultTextColor.Sprint(name),
) )
return cols return cols