diff options
author | skanehira <sho19921005@gmail.com> | 2019-03-23 22:46:08 +0900 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2019-04-06 13:02:20 +1100 |
commit | c350cdba4337fa8961e5fbe16e70d73fae7ccc20 (patch) | |
tree | d0445a56f0d964f6d50f200042851ec8b3c02e7f /pkg/commands/commit.go | |
parent | 1a933eaa731e910cc22e361b93cba8fd5603016f (diff) |
add feature of display diff between specific commits #397
Diffstat (limited to 'pkg/commands/commit.go')
-rw-r--r-- | pkg/commands/commit.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pkg/commands/commit.go b/pkg/commands/commit.go index 4253a5495..8f23ca001 100644 --- a/pkg/commands/commit.go +++ b/pkg/commands/commit.go @@ -13,6 +13,7 @@ type Commit struct { DisplayString string Action string // one of "", "pick", "edit", "squash", "reword", "drop", "fixup" Copied bool // to know if this commit is ready to be cherry-picked somewhere + Selected bool } // GetDisplayStrings is a function. @@ -52,5 +53,12 @@ func (c *Commit) GetDisplayStrings(isFocused bool) []string { actionString = cyan.Sprint(utils.WithPadding(c.Action, 7)) + " " } - return []string{shaColor.Sprint(c.Sha), actionString + white.Sprint(c.Name)} + name := "" + if c.Selected { + name = color.New(color.FgMagenta).Sprint(c.Name) + } else { + name = white.Sprint(c.Name) + } + + return []string{shaColor.Sprint(c.Sha), actionString + name} } |