Apply facing-line rule to input border as well

Visible input border suppressed separator even when it draws no line
toward list section (bottom in default layout, top in reverse, vertical).
Suppress only when input border has a line on the list side; otherwise
fall through to adjacent section check.

Also requires header window to have content before treating it as the
facing section; hasHeaderWindow returns true with empty header when
input border is visible.
This commit is contained in:
Junegunn Choi
2026-07-18 01:05:47 +09:00
parent 083045ad53
commit c434be7bf5
3 changed files with 21 additions and 4 deletions
+8 -1
View File
@@ -3699,7 +3699,14 @@ func (opts *Options) noSeparatorLine() bool {
// NOTE: This does not know that the default separator can be suppressed at
// runtime (see Terminal.separatorLength), so the minimum heights derived
// from it can be one line taller than strictly necessary.
sep := opts.Separator == nil && !opts.InputBorderShape.Visible() || opts.Separator != nil && len(*opts.Separator) > 0
//
// Whether the input border draws a line on the side facing the list
// section; BorderLine always resolves to that side (see NewTerminal)
shape := opts.InputBorderShape
facingLine := shape == tui.BorderLine ||
opts.Layout == layoutReverse && shape.HasBottom() ||
opts.Layout != layoutReverse && shape.HasTop()
sep := opts.Separator == nil && !facingLine || opts.Separator != nil && len(*opts.Separator) > 0
return noSeparatorLine(opts.InfoStyle, sep)
}