1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-02-09 13:47:11 +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
commit 26989ce0ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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