Clarify comment on height overestimation

This commit is contained in:
Junegunn Choi
2026-07-18 00:52:44 +09:00
parent 235ef3c95c
commit 083045ad53
+3 -3
View File
@@ -3696,9 +3696,9 @@ func (opts *Options) noSeparatorLine() bool {
if opts.Inputless {
return true
}
// NOTE: This can overestimate by one line when the default separator is
// suppressed at runtime (see Terminal.separatorLength), making the height
// lower bounds derived from it one line more generous than necessary.
// 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
return noSeparatorLine(opts.InfoStyle, sep)
}