From d075c00015c3a2045061f289f0a089bc7ad6de5a Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 1 Feb 2025 09:28:02 +0900 Subject: [PATCH] Fix --layout reverse-list --no-input --- src/terminal.go | 9 ++++++--- test/test_layout.rb | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/terminal.go b/src/terminal.go index b63af45b..d75f8a6d 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -2184,9 +2184,12 @@ func (t *Terminal) move(y int, x int, clear bool) { case layoutDefault: y = h - y - 1 case layoutReverseList: - n := 2 + t.visibleHeaderLinesInList() - if t.noSeparatorLine() { - n-- + n := t.visibleHeaderLinesInList() + if !t.inputless { + n++ + } + if !t.noSeparatorLine() { + n++ } if y < n { y = h - y - 1 diff --git a/test/test_layout.rb b/test/test_layout.rb index 6e844527..1c5dfca7 100644 --- a/test/test_layout.rb +++ b/test/test_layout.rb @@ -891,4 +891,19 @@ class TestLayout < TestInteractive BLOCK tmux.until { assert_block(block, _1) } end + + def test_min_height_auto_no_input_reverse_list + tmux.send_keys %(seq 100 | #{FZF} --style full:sharp --layout reverse-list --no-input --height 1% --min-height 5+), :Enter + + block = <<~BLOCK + ┌───────── + │ > 1 + │ 2 + │ 3 + │ 4 + │ 5 + └───────── + BLOCK + tmux.until { assert_block(block, _1) } + end end