1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-09 09:22:48 +03:00

some refactoring in anticipation of the graph feature

This commit is contained in:
Jesse Duffield
2021-11-01 09:35:54 +11:00
parent 7a464ae5b7
commit 2fc1498517
40 changed files with 523 additions and 411 deletions

View File

@@ -202,8 +202,7 @@ func (gui *Gui) cleanString(s string) string {
}
func (gui *Gui) setViewContentSync(v *gocui.View, s string) {
v.Clear()
fmt.Fprint(v, gui.cleanString(s))
v.SetContent(gui.cleanString(s))
}
func (gui *Gui) setViewContent(v *gocui.View, s string) {
@@ -305,12 +304,8 @@ func (gui *Gui) refreshSelectedLine(panelState IListPanelState, total int) {
}
func (gui *Gui) renderDisplayStrings(v *gocui.View, displayStrings [][]string) {
gui.g.Update(func(g *gocui.Gui) error {
list := utils.RenderDisplayStrings(displayStrings)
v.Clear()
fmt.Fprint(v, list)
return nil
})
list := utils.RenderDisplayStrings(displayStrings)
v.SetContent(list)
}
func (gui *Gui) globalOptionsMap() map[string]string {
@@ -388,3 +383,7 @@ func getTabbedView(gui *Gui) *gocui.View {
view, _ := gui.g.View(context.GetViewName())
return view
}
func (gui *Gui) render() {
gui.g.Update(func(g *gocui.Gui) error { return nil })
}