MCPcopy
hub / github.com/jesseduffield/lazygit / flush

Method flush

pkg/gocui/gui.go:1143–1169  ·  view source on GitHub ↗

flush updates the gui, re-drawing frames and buffers.

()

Source from the content-addressed store, hash-verified

1141
1142// flush updates the gui, re-drawing frames and buffers.
1143func (g *Gui) flush() error {
1144 // pretty sure we don't need this, but keeping it here in case we get weird visual artifacts
1145 // g.clear(g.FgColor, g.BgColor)
1146
1147 maxX, maxY := Screen.Size()
1148 // if GUI's size has changed, we need to redraw all views
1149 if maxX != g.maxX || maxY != g.maxY {
1150 for _, v := range g.views {
1151 v.clearViewLines()
1152 }
1153 }
1154 g.maxX, g.maxY = maxX, maxY
1155
1156 for _, m := range g.managers {
1157 if err := m.Layout(g); err != nil {
1158 return err
1159 }
1160 }
1161 for _, v := range g.views {
1162 if err := g.draw(v); err != nil {
1163 return err
1164 }
1165 }
1166
1167 Screen.Show()
1168 return nil
1169}
1170
1171// Redraws only tainted views and skips the layout pass.
1172// tcell's cell-level dirty tracking ensures only

Calls 5

drawMethod · 0.95
clearViewLinesMethod · 0.80
ShowMethod · 0.80
LayoutMethod · 0.65
SizeMethod · 0.45