Fix panic when use header border without pointer/marker (#4345)

This commit is contained in:
phanium 2025-04-13 19:24:29 +08:00 committed by GitHub
parent ed4442d9ea
commit 66df24040f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 0 deletions

View File

@ -2647,6 +2647,9 @@ func (t *Terminal) headerIndent(borderShape tui.BorderShape) int {
} }
if borderShape.HasLeft() { if borderShape.HasLeft() {
indentSize -= 1 + t.borderWidth indentSize -= 1 + t.borderWidth
if indentSize < 0 {
indentSize = 0
}
} }
return indentSize return indentSize
} }

View File

@ -991,4 +991,16 @@ class TestLayout < TestInteractive
BLOCK BLOCK
tmux.until { assert_block(block, it) } tmux.until { assert_block(block, it) }
end end
def test_header_border_no_pointer_and_marker
tmux.send_keys %(seq 10 | #{FZF} --header-lines 1 --header-border sharp --no-list-border --pointer '' --marker ''), :Enter
block = <<~BLOCK
1
9/9
>
BLOCK
tmux.until { assert_block(block, it) }
end
end end