From f7f8b35f6c98f06ffb020fb2b71bb2d0a4f5135c Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Fri, 17 Jul 2026 23:47:50 +0900 Subject: [PATCH] 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)' --- src/terminal.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/terminal.go b/src/terminal.go index 66bef46f..8e4968ef 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -1717,11 +1717,13 @@ func (t *Terminal) separatedByBorder() bool { if t.inputBorderShape.Visible() { return true } - if t.previewOpts.position == posNext { - // A preview window at 'next' position sits right next to the input - // section instead. Keep the separator, as the visibility and the - // border of the preview window can change at runtime. - return false + 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 + // section instead. Keep the separator, as the visibility and the + // border of the preview window can change at runtime. + return false + } } hasHeaderLinesWindow, headerLinesShape := t.determineHeaderLinesShape() hasHeaderWindow := t.hasHeaderWindow()