1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

refactor the way we render lists

This commit is contained in:
Jesse Duffield
2020-02-25 20:55:36 +11:00
parent 9fd9fd6816
commit f94d0be2c9
29 changed files with 250 additions and 545 deletions

View File

@ -396,20 +396,6 @@ func (gui *Gui) renderDisplayStrings(v *gocui.View, displayStrings [][]string) {
})
}
func (gui *Gui) renderListPanel(v *gocui.View, items interface{}) error {
gui.g.Update(func(g *gocui.Gui) error {
isFocused := gui.g.CurrentView().Name() == v.Name()
list, err := utils.RenderList(items, isFocused)
if err != nil {
return gui.createErrorPanel(gui.g, err.Error())
}
v.Clear()
fmt.Fprint(v, list)
return nil
})
return nil
}
func (gui *Gui) renderPanelOptions() error {
currentView := gui.g.CurrentView()
switch currentView.Name() {