mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-17 07:43:39 -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:
@@ -39,11 +39,11 @@ class TestLayout < TestInteractive
|
||||
tmux.send_keys "seq 1000 | #{FZF} --header foobar --header-lines 3 --header-first", :Enter
|
||||
block = <<~OUTPUT
|
||||
> 4
|
||||
997/997
|
||||
>
|
||||
3
|
||||
2
|
||||
1
|
||||
997/997
|
||||
>
|
||||
foobar
|
||||
OUTPUT
|
||||
tmux.until { assert_block(block, it) }
|
||||
@@ -53,10 +53,10 @@ class TestLayout < TestInteractive
|
||||
tmux.send_keys "seq 1000 | #{FZF} --header foobar --header-lines 3 --header-first --reverse --inline-info", :Enter
|
||||
block = <<~OUTPUT
|
||||
foobar
|
||||
> < 997/997
|
||||
1
|
||||
2
|
||||
3
|
||||
> < 997/997
|
||||
> 4
|
||||
OUTPUT
|
||||
tmux.until { assert_block(block, it) }
|
||||
@@ -148,10 +148,10 @@ class TestLayout < TestInteractive
|
||||
│
|
||||
│ 4
|
||||
│ > 3
|
||||
│ 2/2
|
||||
│ >
|
||||
│ 2
|
||||
│ 1
|
||||
│ 2/2
|
||||
│ >
|
||||
│ foo
|
||||
╰───────
|
||||
OUTPUT
|
||||
@@ -609,11 +609,11 @@ class TestLayout < TestInteractive
|
||||
│ 4
|
||||
│ > 3
|
||||
╰──────────
|
||||
2
|
||||
1
|
||||
98/98 ─
|
||||
>
|
||||
╭──────────
|
||||
│ 2
|
||||
│ 1
|
||||
│ hello
|
||||
╰──────────
|
||||
BLOCK
|
||||
@@ -666,12 +666,12 @@ class TestLayout < TestInteractive
|
||||
│ 4
|
||||
│ > 3
|
||||
╰──────────
|
||||
98/98 ─
|
||||
>
|
||||
╔══════════
|
||||
║ 2
|
||||
║ 1
|
||||
╚══════════
|
||||
98/98 ─
|
||||
>
|
||||
BLOCK
|
||||
tmux.until { assert_block(block1, it) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user