mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-06-03 16:00:49 +00:00
Fix regression where tcell renderer not clearing the preview window
This commit is contained in:
parent
21ab64e962
commit
d0466fa777
|
@ -1942,9 +1942,14 @@ func (t *Terminal) renderPreviewArea(unchanged bool) {
|
||||||
t.pwindow.MoveAndClear(0, 0) // Clear scroll offset display
|
t.pwindow.MoveAndClear(0, 0) // Clear scroll offset display
|
||||||
} else {
|
} else {
|
||||||
t.previewed.filled = false
|
t.previewed.filled = false
|
||||||
// We don't erase the window here to avoid flickering during scroll
|
// We don't erase the window here to avoid flickering during scroll.
|
||||||
t.pwindow.DrawBorder()
|
// However, tcell renderer uses double-buffering technique and there's no
|
||||||
t.pwindow.Move(0, 0)
|
// flickering. So we just erase the window and make the rest of the code
|
||||||
|
// simpler.
|
||||||
|
if !t.pwindow.EraseMaybe() {
|
||||||
|
t.pwindow.DrawBorder()
|
||||||
|
t.pwindow.Move(0, 0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
height := t.pwindow.Height()
|
height := t.pwindow.Height()
|
||||||
|
|
|
@ -1109,3 +1109,7 @@ func (w *LightWindow) Erase() {
|
||||||
w.FinishFill()
|
w.FinishFill()
|
||||||
w.Move(0, 0)
|
w.Move(0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (w *LightWindow) EraseMaybe() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
|
@ -555,6 +555,11 @@ func (w *TcellWindow) Erase() {
|
||||||
fill(w.left-1, w.top, w.width+1, w.height-1, w.normal, ' ')
|
fill(w.left-1, w.top, w.width+1, w.height-1, w.normal, ' ')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (w *TcellWindow) EraseMaybe() bool {
|
||||||
|
w.Erase()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
func (w *TcellWindow) Enclose(y int, x int) bool {
|
func (w *TcellWindow) Enclose(y int, x int) bool {
|
||||||
return x >= w.left && x < (w.left+w.width) &&
|
return x >= w.left && x < (w.left+w.width) &&
|
||||||
y >= w.top && y < (w.top+w.height)
|
y >= w.top && y < (w.top+w.height)
|
||||||
|
|
|
@ -526,6 +526,7 @@ type Window interface {
|
||||||
Fill(text string) FillReturn
|
Fill(text string) FillReturn
|
||||||
CFill(fg Color, bg Color, attr Attr, text string) FillReturn
|
CFill(fg Color, bg Color, attr Attr, text string) FillReturn
|
||||||
Erase()
|
Erase()
|
||||||
|
EraseMaybe() bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type FullscreenRenderer struct {
|
type FullscreenRenderer struct {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user