summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-01-06 10:08:25 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2025-01-06 10:09:59 +0900
commit6444cc7905a5459b5346d069ec2465df83b82793 (patch)
tree126834a5fa956ac83ec1370dd2ba09a07d3084c9 /src
parent328af1f397297729f2d82b23c13ece76099d295f (diff)
downloadfzf-6444cc7905a5459b5346d069ec2465df83b82793.tar.gz
Render preview label if possible when --preview-border=line
Diffstat (limited to 'src')
-rw-r--r--src/terminal.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/terminal.go b/src/terminal.go
index 27c2305f..f22ec1ca 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -2014,7 +2014,9 @@ func (t *Terminal) resizeWindows(forcePreview bool, redrawBorder bool) {
// Print border label
t.printLabel(t.wborder, t.listLabel, t.listLabelOpts, t.listLabelLen, t.listBorderShape, false)
t.printLabel(t.border, t.borderLabel, t.borderLabelOpts, t.borderLabelLen, t.borderShape, false)
- t.printLabel(t.pborder, t.previewLabel, t.previewLabelOpts, t.previewLabelLen, t.activePreviewOpts.border, false)
+ if t.pborder != nil && t.pwindow.Height() != t.pborder.Height() { // To address --preview-border=line with different positions
+ t.printLabel(t.pborder, t.previewLabel, t.previewLabelOpts, t.previewLabelLen, t.activePreviewOpts.border, false)
+ }
t.printLabel(t.inputBorder, t.inputLabel, t.inputLabelOpts, t.inputLabelLen, t.inputBorderShape, false)
t.printLabel(t.headerBorder, t.headerLabel, t.headerLabelOpts, t.headerLabelLen, t.headerBorderShape, false)
}
@@ -2029,7 +2031,7 @@ func (t *Terminal) printLabel(window tui.Window, render labelPrinter, opts label
}
switch borderShape {
- case tui.BorderHorizontal, tui.BorderTop, tui.BorderBottom, tui.BorderRounded, tui.BorderSharp, tui.BorderBold, tui.BorderBlock, tui.BorderThinBlock, tui.BorderDouble:
+ case tui.BorderHorizontal, tui.BorderTop, tui.BorderBottom, tui.BorderRounded, tui.BorderSharp, tui.BorderBold, tui.BorderBlock, tui.BorderThinBlock, tui.BorderDouble, tui.BorderLine:
if redrawBorder {
window.DrawHBorder()
}