mirror of
https://github.com/junegunn/fzf.git
synced 2026-07-29 11:16:52 +08:00
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:
+1
-8
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user