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/files_panel.go | |
parent | 9fd9fd6816925debe64aa21269cdba5ec74ed5e9 (diff) |
refactor the way we render lists
Diffstat (limited to 'pkg/gui/files_panel.go')
-rw-r--r-- | pkg/gui/files_panel.go | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go index 9e81009ea..4e00dc523 100644 --- a/pkg/gui/files_panel.go +++ b/pkg/gui/files_panel.go @@ -12,7 +12,7 @@ import ( "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 @@ -103,14 +103,8 @@ func (gui *Gui) refreshFiles() error { } gui.g.Update(func(g *gocui.Gui) error { - - filesView.Clear() - isFocused := gui.g.CurrentView().Name() == "files" - list, err := utils.RenderList(gui.State.Files, isFocused) - if err != nil { - return err - } - fmt.Fprint(filesView, list) + displayStrings := presentation.GetFileListDisplayStrings(gui.State.Files) + gui.renderDisplayStrings(filesView, displayStrings) if g.CurrentView() == filesView || (g.CurrentView() == gui.getMainView() && g.CurrentView().Context == "merging") { newSelectedFile, _ := gui.getSelectedFile(gui.g) |