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/stash_panel.go | |
parent | 9fd9fd6816925debe64aa21269cdba5ec74ed5e9 (diff) |
refactor the way we render lists
Diffstat (limited to 'pkg/gui/stash_panel.go')
-rw-r--r-- | pkg/gui/stash_panel.go | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/pkg/gui/stash_panel.go b/pkg/gui/stash_panel.go index 9ca72dee0..db12767e8 100644 --- a/pkg/gui/stash_panel.go +++ b/pkg/gui/stash_panel.go @@ -1,11 +1,9 @@ package gui import ( - "fmt" - "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/commands" - "github.com/jesseduffield/lazygit/pkg/utils" + "github.com/jesseduffield/lazygit/pkg/gui/presentation" ) // list panel functions @@ -56,17 +54,12 @@ func (gui *Gui) refreshStashEntries(g *gocui.Gui) error { gui.refreshSelectedLine(&gui.State.Panels.Stash.SelectedLine, len(gui.State.StashEntries)) - isFocused := gui.g.CurrentView().Name() == "stash" - list, err := utils.RenderList(gui.State.StashEntries, isFocused) - if err != nil { - return err - } + stashView := gui.getStashView() - v := gui.getStashView() - v.Clear() - fmt.Fprint(v, list) + displayStrings := presentation.GetStashEntryListDisplayStrings(gui.State.StashEntries) + gui.renderDisplayStrings(stashView, displayStrings) - if err := gui.resetOrigin(v); err != nil { + if err := gui.resetOrigin(stashView); err != nil { return err } return nil |