Fix header window not updated on change-header

This commit is contained in:
Junegunn Choi 2025-03-28 23:22:09 +09:00
parent 376142eb0d
commit 0dce561ec9
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627
2 changed files with 13 additions and 1 deletions

View File

@ -5133,7 +5133,12 @@ func (t *Terminal) Loop() error {
header = t.captureLines(a.a) header = t.captureLines(a.a)
} }
if t.changeHeader(header) { if t.changeHeader(header) {
if t.headerWindow != nil {
// Need to resize header window
req(reqFullRedraw)
} else {
req(reqHeader, reqList, reqPrompt, reqInfo) req(reqHeader, reqList, reqPrompt, reqInfo)
}
} else { } else {
req(reqHeader) req(reqHeader)
} }

View File

@ -1920,4 +1920,11 @@ class TestCore < TestInteractive
tmux.send_keys :Up tmux.send_keys :Up
tmux.until { |lines| assert_includes lines, ' 2' } tmux.until { |lines| assert_includes lines, ' 2' }
end end
def test_change_header_on_header_window
tmux.send_keys %(seq 100 | #{FZF} --list-border --input-border --bind 'start:change-header(foo),space:change-header(bar)'), :Enter
tmux.until { |lines| assert lines.any_include?('foo') }
tmux.send_keys :Space
tmux.until { |lines| assert lines.any_include?('bar') }
end
end end