summaryrefslogtreecommitdiffstats
path: root/src/tui/light.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2024-03-09 14:01:49 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2024-03-09 14:14:42 +0900
commit26244ad8c21ccc946393e10eea7d6b1ad32096e1 (patch)
tree8264f57f1cc339b87517e2d20eef15bb13800460 /src/tui/light.go
parentfa0aa5510d1d78a80363e053f2db5502f9bac416 (diff)
Fix preview area not being cleared when using certain types of border styles
fzf --preview 'sleep 3; date' --preview-window hidden \ --bind ctrl-/:change-preview-window:up,border-bottom
Diffstat (limited to 'src/tui/light.go')
-rw-r--r--src/tui/light.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/tui/light.go b/src/tui/light.go
index a5911524..216c4c36 100644
--- a/src/tui/light.go
+++ b/src/tui/light.go
@@ -808,13 +808,25 @@ func (w *LightWindow) drawBorderHorizontal(top, bottom bool) {
color = ColPreviewBorder
}
hw := runeWidth(w.border.top)
+ pad := repeat(' ', w.width/hw)
+
+ w.Move(0, 0)
if top {
- w.Move(0, 0)
w.CPrint(color, repeat(w.border.top, w.width/hw))
+ } else {
+ w.CPrint(color, pad)
}
+
+ for y := 1; y < w.height-1; y++ {
+ w.Move(y, 0)
+ w.CPrint(color, pad)
+ }
+
+ w.Move(w.height-1, 0)
if bottom {
- w.Move(w.height-1, 0)
w.CPrint(color, repeat(w.border.bottom, w.width/hw))
+ } else {
+ w.CPrint(color, pad)
}
}