From e6356ce10c0d094db3d3d61847a161c3d708aea1 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sat, 12 Aug 2023 16:34:04 +1000 Subject: [PATCH] Show commit mark before showing extra info The 'YOU ARE HERE' marking should be shown before we show things like the current tag, otherwise it could be missed --- pkg/gui/presentation/commits.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/gui/presentation/commits.go b/pkg/gui/presentation/commits.go index f5915a7ee..6661e9d30 100644 --- a/pkg/gui/presentation/commits.go +++ b/pkg/gui/presentation/commits.go @@ -341,16 +341,17 @@ func displayCommit( name = emoji.Sprint(name) } + mark := "" if isYouAreHereCommit { color := lo.Ternary(commit.Action == models.ActionConflict, style.FgRed, style.FgYellow) youAreHere := color.Sprintf("<-- %s ---", common.Tr.YouAreHere) - name = fmt.Sprintf("%s %s", youAreHere, name) + mark = fmt.Sprintf("%s ", youAreHere) } else if isMarkedBaseCommit { rebaseFromHere := style.FgYellow.Sprint(common.Tr.MarkedCommitMarker) - name = fmt.Sprintf("%s %s", rebaseFromHere, name) + mark = fmt.Sprintf("%s ", rebaseFromHere) } else if !willBeRebased { willBeRebased := style.FgYellow.Sprint("✓") - name = fmt.Sprintf("%s %s", willBeRebased, name) + mark = fmt.Sprintf("%s ", willBeRebased) } authorFunc := authors.ShortAuthor @@ -373,7 +374,7 @@ func displayCommit( cols, actionString, authorFunc(commit.AuthorName), - graphLine+tagString+theme.DefaultTextColor.Sprint(name), + graphLine+mark+tagString+theme.DefaultTextColor.Sprint(name), ) return cols