1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-27 22:38:09 +02:00

More stuff

This commit is contained in:
Jesse Duffield
2018-06-02 13:51:03 +10:00
parent a0c8fc8899
commit 80bcc7c16e
6 changed files with 105 additions and 30 deletions

View File

@@ -11,20 +11,26 @@ import (
func refreshStatus(g *gocui.Gui) error {
v, err := g.View("status")
if err != nil {
return err
panic(err)
}
v.Clear()
up, down := gitUpstreamDifferenceCount()
fmt.Fprint(v, "↑"+up+"↓"+down)
branches := state.Branches
if len(branches) == 0 {
// for some reason if this isn't wrapped in an update the clear seems to
// be applied after the other things or something like that; the panel's
// contents end up cleared
g.Update(func(*gocui.Gui) error {
v.Clear()
pushables, pullables := gitUpstreamDifferenceCount()
fmt.Fprint(v, "↑"+pushables+"↓"+pullables)
branches := state.Branches
if len(branches) == 0 {
return nil
}
branch := branches[0]
// utilising the fact these all have padding to only grab the name
// from the display string with the existing coloring applied
fmt.Fprint(v, " "+branch.DisplayString[4:])
colorLog(color.FgCyan, time.Now().Sub(StartTime))
return nil
}
branch := branches[0]
// utilising the fact these all have padding to only grab the name
// from the display string with the existing coloring applied
fmt.Fprint(v, " "+branch.DisplayString[4:])
})
colorLog(color.FgCyan, time.Now().Sub(StartTime))
return nil
}