From 328af1f397297729f2d82b23c13ece76099d295f Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 6 Jan 2025 09:28:07 +0900 Subject: Remove header indentation when unnecessary # Indent the header to align with the entries in the list fzf --header 'Hello' --header-border --list-border # No extra indentation required fzf --header 'Hello' --header-border --- src/terminal.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/terminal.go b/src/terminal.go index 344246de..27c2305f 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -2386,7 +2386,11 @@ func (t *Terminal) printHeaderImpl() { } // Wrapping is not supported for header wrap := t.wrap - indent := strings.Repeat(" ", t.pointerLen+t.markerLen) + indentSize := t.pointerLen + t.markerLen + if t.headerBorderShape.HasLeft() && !t.listBorderShape.HasLeft() { + indentSize = util.Max(0, indentSize-(1+t.borderWidth)) + } + indent := strings.Repeat(" ", indentSize) t.wrap = false for idx, lineStr := range append(append([]string{}, t.header0...), t.header...) { line := idx -- cgit v1.2.3