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:
Junegunn Choi committed 2026-09-06 11:27:17 +09:00
1 parent a52ac843d7
commit 1372d04f79
3 files changed
+35 -3

No files matched your search

+22
View File
@@ -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