diff options
author | skanehira <sho19921005@gmail.com> | 2019-03-28 18:58:34 +0900 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2019-04-06 13:02:20 +1100 |
commit | f34be1896af14df2d636aa9aa3cfa857994a22b5 (patch) | |
tree | 5ab2fdbb29f2b95b074aa2075f5e3bab8fd66b8c /pkg/commands/commit.go | |
parent | c350cdba4337fa8961e5fbe16e70d73fae7ccc20 (diff) |
fixed some #397
Diffstat (limited to 'pkg/commands/commit.go')
-rw-r--r-- | pkg/commands/commit.go | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/pkg/commands/commit.go b/pkg/commands/commit.go index 8f23ca001..e8a0a52e7 100644 --- a/pkg/commands/commit.go +++ b/pkg/commands/commit.go @@ -9,11 +9,10 @@ import ( type Commit struct { Sha string Name string - Status string // one of "unpushed", "pushed", "merged", or "rebasing" + Status string // one of "unpushed", "pushed", "merged", "rebasing" or "selected" 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. @@ -24,6 +23,7 @@ func (c *Commit) GetDisplayStrings(isFocused bool) []string { blue := color.New(color.FgBlue) cyan := color.New(color.FgCyan) white := color.New(color.FgWhite) + magenta := color.New(color.FgMagenta) // for some reason, setting the background to blue pads out the other commits // horizontally. For the sake of accessibility I'm considering this a feature, @@ -40,6 +40,8 @@ func (c *Commit) GetDisplayStrings(isFocused bool) []string { shaColor = green case "rebasing": shaColor = blue + case "selected": + shaColor = magenta default: shaColor = white } @@ -53,12 +55,5 @@ func (c *Commit) GetDisplayStrings(isFocused bool) []string { actionString = cyan.Sprint(utils.WithPadding(c.Action, 7)) + " " } - 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} + return []string{shaColor.Sprint(c.Sha), actionString + white.Sprint(c.Name)} } |