mirror of
https://github.com/junegunn/fzf.git
synced 2026-09-11 01:03:03 +08:00
Fix adaptive height with an inline header or footer border
- extraLines() used borderLines(), which reports zero for BorderInline
- Divider drawn for an inline section still takes a line, and
resizeWindows() reserves it via addInline()
- So adaptive height came up one line short per inline section and the
list scrolled
- Affects --header-lines-border, --header-border and --footer-border
alike. All three set came up three lines short
- Without a list border the shape normalizes to BorderTop or BorderBottom,
which report a line, hence --no-list-border looked like a fix
seq 10 | fzf --height=~100% --list-border \
--header-lines=1 --header-lines-border=inline
Fix #4904
This commit is contained in:
@@ -882,6 +882,28 @@ class TestLayout < TestInteractive
|
||||
tmux.until { assert_block(block, it) }
|
||||
end
|
||||
|
||||
def test_adaptive_height_with_inline_sections
|
||||
tmux.send_keys %(seq 10 | #{FZF} --height=~100% --list-border --header-lines=1 --header-lines-border=inline), :Enter
|
||||
block = <<~BLOCK
|
||||
╭──────
|
||||
│ 10
|
||||
│ 9
|
||||
│ 8
|
||||
│ 7
|
||||
│ 6
|
||||
│ 5
|
||||
│ 4
|
||||
│ 3
|
||||
│ > 2
|
||||
├──────
|
||||
│ 1
|
||||
╰──────
|
||||
9/9
|
||||
>
|
||||
BLOCK
|
||||
tmux.until { assert_block(block, it) }
|
||||
end
|
||||
|
||||
def test_style_full_adaptive_height
|
||||
tmux.send_keys %(seq 1| #{FZF} --style=full:rounded --height=~100% --header-lines=1 --info=default), :Enter
|
||||
block = <<~BLOCK
|
||||
|
||||
Reference in New Issue
Block a user