From ee3916be17a340205875f9ccfaf71a1683a2fdf9 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 2 Jan 2025 16:24:46 +0900 Subject: Border around the input section (prompt + info) Close #4154 --- src/tui/tcell.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/tui/tcell.go') 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() } -- cgit v1.2.3