summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-03-19 09:14:59 +1100
committerJesse Duffield <jessedduffield@gmail.com>2020-03-19 21:42:21 +1100
commit3aab37611a26834af8348441d864ecad3eb15674 (patch)
tree49f9ed40a40a45dffaf3ff683f44e63d85f2ab8c
parent8fbcc36331cb5ac7a61493ff185782d6233d4673 (diff)
show status of selected cherry picked commits
-rw-r--r--pkg/gui/gui.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index 42f4bfc75..1ae9199eb 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -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 {