summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-01-07 19:16:16 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2025-01-07 19:16:16 +0900
commit9c2f6cae88aa46b5dd54edd813dd1604aa6d5386 (patch)
treed438ca4f6951d5d9f8a61988452ff518b4ea9727
parenta30181e2407057435763ef1bfb444cc8aaa29d38 (diff)
downloadfzf-9c2f6cae88aa46b5dd54edd813dd1604aa6d5386.tar.gz
Fix adaptive height with --header-border
-rw-r--r--src/terminal.go3
-rwxr-xr-xtest/test_go.rb16
2 files changed, 19 insertions, 0 deletions
diff --git a/src/terminal.go b/src/terminal.go
index f22ec1ca..cb560b90 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -1093,6 +1093,9 @@ func (t *Terminal) extraLines() int {
if t.listBorderShape.Visible() {
extra += borderLines(t.listBorderShape)
}
+ if t.headerBorderShape.Visible() {
+ extra += borderLines(t.headerBorderShape)
+ }
if !t.noSeparatorLine() {
extra++
}
diff --git a/test/test_go.rb b/test/test_go.rb
index 8f52fd62..edefebd1 100755
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -3702,6 +3702,22 @@ class TestGoFZF < TestBase
BLOCK
tmux.until { assert_block(block, _1) }
end
+
+ def test_style_full_adaptive_height
+ tmux.send_keys %(seq 1| #{FZF} --style=full --height=~100% --header-lines=1 --info=default), :Enter
+ block = <<~BLOCK
+ ╭────────
+ ╰────────
+ ╭────────
+ │ 1
+ ╰────────
+ ╭────────
+ │ 0/0
+ │ >
+ ╰────────
+ BLOCK
+ tmux.until { assert_block(block, _1) }
+ end
end
module TestShell