diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2023-11-02 21:00:07 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2023-11-02 21:00:07 +0900 |
commit | d0466fa77714cccae6875facafb4a7d49e3f958e (patch) | |
tree | 6f46912b1be2fbefeaae713aed54e257df15c249 /src/tui | |
parent | 21ab64e96213ec99cf3f6f207690ffe710713fcc (diff) |
Fix regression where tcell renderer not clearing the preview window
Diffstat (limited to 'src/tui')
-rw-r--r-- | src/tui/light.go | 4 | ||||
-rw-r--r-- | src/tui/tcell.go | 5 | ||||
-rw-r--r-- | src/tui/tui.go | 1 |
3 files changed, 10 insertions, 0 deletions
diff --git a/src/tui/light.go b/src/tui/light.go index d26a48f6..e5950cde 100644 --- a/src/tui/light.go +++ b/src/tui/light.go @@ -1109,3 +1109,7 @@ func (w *LightWindow) Erase() { w.FinishFill() w.Move(0, 0) } + +func (w *LightWindow) EraseMaybe() bool { + return false +} diff --git a/src/tui/tcell.go b/src/tui/tcell.go index d0a710a3..38641f7a 100644 --- a/src/tui/tcell.go +++ b/src/tui/tcell.go @@ -555,6 +555,11 @@ func (w *TcellWindow) Erase() { 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 { return x >= w.left && x < (w.left+w.width) && y >= w.top && y < (w.top+w.height) diff --git a/src/tui/tui.go b/src/tui/tui.go index 7ba437aa..5a5e18d6 100644 --- a/src/tui/tui.go +++ b/src/tui/tui.go @@ -526,6 +526,7 @@ type Window interface { Fill(text string) FillReturn CFill(fg Color, bg Color, attr Attr, text string) FillReturn Erase() + EraseMaybe() bool } type FullscreenRenderer struct { |