diff options
author | Jesse Duffield Duffield <jesseduffieldduffield@Jesses-MacBook-Pro-3.local> | 2019-02-24 13:51:52 +1100 |
---|---|---|
committer | Jesse Duffield Duffield <jesseduffieldduffield@Jesses-MacBook-Pro-3.local> | 2019-02-24 13:51:52 +1100 |
commit | a8858cbd12bd2ef5766f2436a7d43e4ff1c4ca9f (patch) | |
tree | 19febb0f502e2ff050ddde80de166e8354218ced /pkg/commands/commit.go | |
parent | 1a19b1412d3da03992403cf62fddf06031de2927 (diff) |
support cherry picking commits
Diffstat (limited to 'pkg/commands/commit.go')
-rw-r--r-- | pkg/commands/commit.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/pkg/commands/commit.go b/pkg/commands/commit.go index 1df6afbd0..4253a5495 100644 --- a/pkg/commands/commit.go +++ b/pkg/commands/commit.go @@ -12,6 +12,7 @@ type Commit struct { Status string // one of "unpushed", "pushed", "merged", or "rebasing" 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 } // GetDisplayStrings is a function. @@ -19,9 +20,14 @@ func (c *Commit) GetDisplayStrings(isFocused bool) []string { red := color.New(color.FgRed) yellow := color.New(color.FgYellow) green := color.New(color.FgGreen) - white := color.New(color.FgWhite) blue := color.New(color.FgBlue) cyan := color.New(color.FgCyan) + white := color.New(color.FgWhite) + + // 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, + // not a bug + copied := color.New(color.FgCyan, color.BgBlue) var shaColor *color.Color switch c.Status { @@ -37,6 +43,10 @@ func (c *Commit) GetDisplayStrings(isFocused bool) []string { shaColor = white } + if c.Copied { + shaColor = copied + } + actionString := "" if c.Action != "" { actionString = cyan.Sprint(utils.WithPadding(c.Action, 7)) + " " |