mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-17 00:18:05 +02:00
add feature of display diff between specific commits #397
This commit is contained in:
committed by
Jesse Duffield
parent
1a933eaa73
commit
c350cdba43
@ -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}
|
||||
}
|
||||
|
Reference in New Issue
Block a user