Extract inputBorderFacesList helper

Facing-side rule was written out separately in options.go and
terminal.go; single helper prevents the two from drifting apart
This commit is contained in:
Junegunn Choi
2026-07-18 01:43:12 +09:00
parent 711f810630
commit 5aab8979c6
2 changed files with 14 additions and 10 deletions
+1 -8
View File
@@ -3699,14 +3699,7 @@ 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.
//
// 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
sep := opts.Separator == nil && !inputBorderFacesList(opts.Layout, opts.InputBorderShape) || opts.Separator != nil && len(*opts.Separator) > 0
return noSeparatorLine(opts.InfoStyle, sep)
}