summaryrefslogtreecommitdiff
path: root/src/tui/tcell.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-01-02 16:24:46 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2025-01-02 16:25:00 +0900
commitee3916be17a340205875f9ccfaf71a1683a2fdf9 (patch)
tree0cc0e5d4d7067f0135f01431795a9f4541f7e532 /src/tui/tcell.go
parentfd513f8af8191cd60364497f4184b8accd988282 (diff)
downloadfzf-ee3916be17a340205875f9ccfaf71a1683a2fdf9.tar.gz
Border around the input section (prompt + info)
Close #4154
Diffstat (limited to 'src/tui/tcell.go')
-rw-r--r--src/tui/tcell.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tui/tcell.go b/src/tui/tcell.go
index 92336cd0..becdabcd 100644
--- a/src/tui/tcell.go
+++ b/src/tui/tcell.go
@@ -551,10 +551,14 @@ func (r *FullscreenRenderer) RefreshWindows(windows []Window) {
}
func (r *FullscreenRenderer) NewWindow(top int, left int, width int, height int, windowType WindowType, borderStyle BorderStyle, erase bool) Window {
+ width = util.Max(0, width)
+ height = util.Max(0, height)
normal := ColBorder
switch windowType {
case WindowList:
normal = ColListBorder
+ case WindowInput:
+ normal = ColInputBorder
case WindowPreview:
normal = ColPreviewBorder
}
@@ -768,6 +772,9 @@ func (w *TcellWindow) DrawHBorder() {
}
func (w *TcellWindow) drawBorder(onlyHorizontal bool) {
+ if w.height == 0 {
+ return
+ }
shape := w.borderStyle.shape
if shape == BorderNone {
return
@@ -785,6 +792,8 @@ func (w *TcellWindow) drawBorder(onlyHorizontal bool) {
style = ColBorder.style()
case WindowList:
style = ColListBorder.style()
+ case WindowInput:
+ style = ColInputBorder.style()
case WindowPreview:
style = ColPreviewBorder.style()
}