diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-02-25 20:55:36 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-02-25 21:21:07 +1100 |
commit | f94d0be2c9b0eaaf539d2cdcfaf258f754162a2e (patch) | |
tree | 0fa95e6348ca35d0938d263b007d9c471a09731e /pkg/gui/gui.go | |
parent | 9fd9fd6816925debe64aa21269cdba5ec74ed5e9 (diff) |
refactor the way we render lists
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r-- | pkg/gui/gui.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index 4cf435b8f..70c3c3f51 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -24,6 +24,7 @@ import ( "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/commands" "github.com/jesseduffield/lazygit/pkg/config" + "github.com/jesseduffield/lazygit/pkg/gui/presentation" "github.com/jesseduffield/lazygit/pkg/i18n" "github.com/jesseduffield/lazygit/pkg/tasks" "github.com/jesseduffield/lazygit/pkg/theme" @@ -270,7 +271,7 @@ func NewGui(log *logrus.Entry, gitCommand *commands.GitCommand, oSCommand *comma func (gui *Gui) nextScreenMode(g *gocui.Gui, v *gocui.View) error { gui.State.ScreenMode = utils.NextIntInCycle([]int{SCREEN_NORMAL, SCREEN_HALF, SCREEN_FULL}, gui.State.ScreenMode) // commits render differently depending on whether we're in fullscreen more or not - if err := gui.renderBranchCommitsWithSelection(); err != nil { + if err := gui.refreshCommitsViewWithSelection(); err != nil { return err } @@ -280,7 +281,7 @@ func (gui *Gui) nextScreenMode(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) prevScreenMode(g *gocui.Gui, v *gocui.View) error { gui.State.ScreenMode = utils.PrevIntInCycle([]int{SCREEN_NORMAL, SCREEN_HALF, SCREEN_FULL}, gui.State.ScreenMode) // commits render differently depending on whether we're in fullscreen more or not - if err := gui.renderBranchCommitsWithSelection(); err != nil { + if err := gui.refreshCommitsViewWithSelection(); err != nil { return err } @@ -382,10 +383,8 @@ func (gui *Gui) onFocusLost(v *gocui.View, newView *gocui.View) error { case "branches": if v.Context == "local-branches" { // This stops the branches panel from showing the upstream/downstream changes to the selected branch, when it loses focus - // inside renderListPanel it checks to see if the panel has focus - if err := gui.renderListPanel(gui.getBranchesView(), gui.State.Branches); err != nil { - return err - } + displayStrings := presentation.GetBranchListDisplayStrings(gui.State.Branches, false, -1) + gui.renderDisplayStrings(gui.getBranchesView(), displayStrings) } case "main": // if we have lost focus to a first-class panel, we need to do some cleanup |