summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-01-12 14:58:55 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2025-01-12 14:58:55 +0900
commit6f943112a9998d504a5660754f400786e79f80b2 (patch)
tree9b7f41e63e21a583765ee151adf75e4f96eb4773 /src
parentf422893b8e697939fb16d68ee01e3c6ee8f1b145 (diff)
downloadfzf-6f943112a9998d504a5660754f400786e79f80b2.tar.gz
Align header with the list
Diffstat (limited to 'src')
-rw-r--r--src/terminal.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/terminal.go b/src/terminal.go
index 853adb8e..1ca1c804 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -2391,9 +2391,19 @@ func (t *Terminal) printHeaderImpl() {
}
// Wrapping is not supported for header
wrap := t.wrap
+
+ // Align header with the list
+ // fzf --header-lines 3 --style full --no-list-border
+ // fzf --header-lines 3 --style full --no-header-border
+ // fzf --header-lines 3 --style full --no-header-border --no-input-border
indentSize := t.pointerLen + t.markerLen
- if t.headerBorderShape.HasLeft() && !t.listBorderShape.HasLeft() {
- indentSize = util.Max(0, indentSize-(1+t.borderWidth))
+ if t.headerWindow != nil {
+ if t.listBorderShape.HasLeft() {
+ indentSize += 1 + t.borderWidth
+ }
+ if t.headerBorderShape.HasLeft() {
+ indentSize -= 1 + t.borderWidth
+ }
}
indent := strings.Repeat(" ", indentSize)
t.wrap = false