1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +03:00

fix rendering issues caused by resizing

This commit is contained in:
Jesse Duffield
2021-04-12 21:33:23 +10:00
parent 0df6ac6140
commit 76697280c9
6 changed files with 24 additions and 15 deletions

View File

@ -272,7 +272,7 @@ func (g *Gui) SetView(name string, x0, y0, x1, y1 int, overlaps byte) (*View, er
if v, err := g.View(name); err == nil {
if v.x0 != x0 || v.x1 != x1 || v.y0 != y0 || v.y1 != y1 {
v.tainted = true
v.clearViewLines()
}
v.x0 = x0
@ -660,11 +660,7 @@ func (g *Gui) handleEvent(ev *GocuiEvent) error {
}
func (g *Gui) onResize() {
for _, v := range g.views {
// wonder if we should be calling this in other contexts e.g. whenever the view's dimensions change in general
v.FlushStaleCells()
}
// Not sure if we actually need this
// not sure if we actually need this
// g.screen.Sync()
}
@ -677,7 +673,7 @@ func (g *Gui) flush() error {
// if GUI's size has changed, we need to redraw all views
if maxX != g.maxX || maxY != g.maxY {
for _, v := range g.views {
v.tainted = true
v.clearViewLines()
}
}
g.maxX, g.maxY = maxX, maxY