Check threshold alternatives for preview at 'next' position

Alternative layout in --preview-window spec can also place preview next
to input section, e.g. 'up,40%,<30(next)'
This commit is contained in:
Junegunn Choi
2026-07-17 23:47:50 +09:00
parent e098a796bb
commit f7f8b35f6c
+3 -1
View File
@@ -1717,12 +1717,14 @@ func (t *Terminal) separatedByBorder() bool {
if t.inputBorderShape.Visible() { if t.inputBorderShape.Visible() {
return true return true
} }
if t.previewOpts.position == posNext { for po := &t.previewOpts; po != nil; po = po.alternative {
if po.position == posNext {
// A preview window at 'next' position sits right next to the input // A preview window at 'next' position sits right next to the input
// section instead. Keep the separator, as the visibility and the // section instead. Keep the separator, as the visibility and the
// border of the preview window can change at runtime. // border of the preview window can change at runtime.
return false return false
} }
}
hasHeaderLinesWindow, headerLinesShape := t.determineHeaderLinesShape() hasHeaderLinesWindow, headerLinesShape := t.determineHeaderLinesShape()
hasHeaderWindow := t.hasHeaderWindow() hasHeaderWindow := t.hasHeaderWindow()
if !hasHeaderWindow && !hasHeaderLinesWindow { if !hasHeaderWindow && !hasHeaderLinesWindow {