Skip to content
Myr

Fix regression where tcell renderer not clearing the preview window

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 21ab64e · Browse files · 4 files+18 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+18 added−3 removed

  • other:+18 added−3 removed

4 files+18 added−3 removed

modified:src/tui/light.go+4 added
1107 unmodified lines
1108 w.Move(0, 0)1109 w.FinishFill()1110 w.Move(0, 0)1111}11121113func (w *LightWindow) EraseMaybe() bool {1114 return false1115}
modified:src/tui/tcell.go+5 added
553 unmodified lines
554 w.drawBorder(false)555 fill(w.left-1, w.top, w.width+1, w.height-1, w.normal, ' ')556}557558func (w *TcellWindow) EraseMaybe() bool {559 w.Erase()560 return true561}562563func (w *TcellWindow) Enclose(y int, x int) bool {564 return x >= w.left && x < (w.left+w.width) &&565 y >= w.top && y < (w.top+w.height)566}
223 unmodified lines
modified:src/tui/tui.go+1 added
524 unmodified lines
525 CPrint(color ColorPair, text string)526 Fill(text string) FillReturn527 CFill(fg Color, bg Color, attr Attr, text string) FillReturn528 Erase()529 EraseMaybe() bool530}531532type FullscreenRenderer struct {533 theme *ColorTheme
280 unmodified lines
modified:src/terminal.go+8 added-3 removed
1940 unmodified lines
1941 } else if unchanged {1942 t.pwindow.MoveAndClear(0, 0) // Clear scroll offset display1943 } else {1944 t.previewed.filled = false1945 // We don't erase the window here to avoid flickering during scroll1946 t.pwindow.DrawBorder()1947 t.pwindow.Move(0, 0)1945 // We don't erase the window here to avoid flickering during scroll.1946 // However, tcell renderer uses double-buffering technique and there's no1947 // flickering. So we just erase the window and make the rest of the code1948 // simpler.1949 if !t.pwindow.EraseMaybe() {1950 t.pwindow.DrawBorder()1951 t.pwindow.Move(0, 0)1952 }1953 }19541955 height := t.pwindow.Height()1956 header := []string{}
2054 unmodified lines