Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -2647,6 +2647,9 @@ func (t *Terminal) headerIndent(borderShape tui.BorderShape) int {
}
if borderShape.HasLeft() {
indentSize -= 1 + t.borderWidth
if indentSize < 0 {
indentSize = 0
}
}
return indentSize
}
Expand Down
12 changes: 12 additions & 0 deletions test/test_layout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -991,4 +991,16 @@ def test_change_header_and_label_at_once
BLOCK
tmux.until { assert_block(block, it) }
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