mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-14 22:33:47 -05:00
Fix inconsistent placement of header-lines with border options
fzf displayed --header-lines inconsistently depending on the presence of borders: # --header and --header-lines co-located seq 10 | fzf --header-lines 3 --header "$(seq 101 103)" --header-first # --header and --header-lines separated seq 10 | fzf --header-lines 3 --header "$(seq 101 103)" --header-first --header-lines-border This commit fixes the inconsistency with the following logic: * If only one of --header or --header-lines is provided, --header-first applies to that single header. * If both are present, --header-first affects only the regular --header, not --header-lines.
This commit is contained in:
@@ -3218,15 +3218,6 @@ func postProcessOptions(opts *Options) error {
|
||||
|
||||
if opts.HeaderLinesShape == tui.BorderNone {
|
||||
opts.HeaderLinesShape = tui.BorderPhantom
|
||||
} else if opts.HeaderLinesShape == tui.BorderUndefined {
|
||||
// In reverse-list layout, header lines should be at the top, while
|
||||
// ordinary header should be at the bottom. So let's use a separate
|
||||
// window for the header lines.
|
||||
if opts.Layout == layoutReverseList {
|
||||
opts.HeaderLinesShape = tui.BorderPhantom
|
||||
} else {
|
||||
opts.HeaderLinesShape = tui.BorderNone
|
||||
}
|
||||
}
|
||||
|
||||
if opts.Pointer == nil {
|
||||
|
||||
Reference in New Issue
Block a user