1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-03-29 22:07:13 +02:00

show status of selected cherry picked commits

This commit is contained in:
Jesse Duffield 2020-03-19 09:14:59 +11:00
parent 8fbcc36331
commit 3aab37611a

View File

@ -213,6 +213,7 @@ type guiState struct {
Ptmx *os.File
PrevMainWidth int
PrevMainHeight int
OldInformation string
}
// for now the split view will always be on
@ -494,6 +495,9 @@ func (gui *Gui) layout(g *gocui.Gui) error {
donate := color.New(color.FgMagenta, color.Underline).Sprint(gui.Tr.SLocalize("Donate"))
information = donate + " " + information
}
if len(gui.State.CherryPickedCommits) > 0 {
information = utils.ColoredString(fmt.Sprintf("%d commits copied", len(gui.State.CherryPickedCommits)), color.FgCyan)
}
minimumHeight := 9
minimumWidth := 10
@ -760,13 +764,14 @@ func (gui *Gui) layout(g *gocui.Gui) error {
}
}
if v, err := g.SetView("information", optionsVersionBoundary-1, height-2, width, height, 0); err != nil {
informationView, err := g.SetView("information", optionsVersionBoundary-1, height-2, width, height, 0)
if err != nil {
if err.Error() != "unknown view" {
return err
}
v.BgColor = gocui.ColorDefault
v.FgColor = gocui.ColorGreen
v.Frame = false
informationView.BgColor = gocui.ColorDefault
informationView.FgColor = gocui.ColorGreen
informationView.Frame = false
gui.renderString(g, "information", information)
// doing this here because it'll only happen once
@ -774,6 +779,10 @@ func (gui *Gui) layout(g *gocui.Gui) error {
return err
}
}
if gui.State.OldInformation != information {
gui.setViewContent(g, informationView, information)
gui.State.OldInformation = information
}
if gui.g.CurrentView() == nil {
if _, err := gui.g.SetCurrentView(gui.getFilesView().Name()); err != nil {