Skip to content
Myr

Fix regression where header is not updated

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent fb570e9 · Browse files · 2 files+13 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+13 added−7 removed

  • tests:+4 added−1 removed
  • other:+9 added−6 removed

2 files+13 added−7 removed

modified:src/terminal.go+9 added-6 removed
2899 unmodified lines
29002901 // Check if the header borders are used and header has changed2902 allHeaderLines := t.visibleHeaderLines()2903 primaryHeaderLines := allHeaderLines2904 if t.hasHeaderLinesWindow() {2904 needHeaderWindow := t.hasHeaderWindow()2905 needHeaderLinesWindow := t.hasHeaderLinesWindow()2906 if needHeaderLinesWindow {2907 primaryHeaderLines -= t.headerLines2908 }2909 // FIXME: Full redraw is triggered if there are too many lines in the header2910 // so that the header window cannot display all of them.2909 needHeaderLinesWindow := t.hasHeaderLinesWindow()2910 if (t.headerBorderShape.Visible() || needHeaderLinesWindow) &&2911 (t.headerWindow == nil && primaryHeaderLines > 0 || t.headerWindow != nil && primaryHeaderLines != t.headerWindow.Height()) ||2912 needHeaderLinesWindow && (t.headerLinesWindow == nil || t.headerLinesWindow != nil && t.headerLines != t.headerLinesWindow.Height()) ||2913 !needHeaderLinesWindow && t.headerLinesWindow != nil {2911 if (needHeaderWindow && t.headerWindow == nil) ||2912 (!needHeaderWindow && t.headerWindow != nil) ||2913 (needHeaderWindow && t.headerWindow != nil && primaryHeaderLines != t.headerWindow.Height()) ||2914 (needHeaderLinesWindow && t.headerLinesWindow == nil) ||2915 (!needHeaderLinesWindow && t.headerLinesWindow != nil) ||2916 (needHeaderLinesWindow && t.headerLinesWindow != nil && t.headerLines != t.headerLinesWindow.Height()) {2917 t.printAll()2918 return true2919 }2920 return false
4008 unmodified lines
modified:test/test_core.rb+4 added-1 removed
1928 unmodified lines
1929 end19301931 def test_change_header_on_header_window1932 tmux.send_keys %(seq 100 | #{FZF} --list-border --input-border --bind 'start:change-header(foo),space:change-header(bar)'), :Enter1933 tmux.until { |lines| assert lines.any_include?('foo') }1933 tmux.until do |lines|1934 assert lines.any_include?('100/100')1935 assert lines.any_include?('foo')1936 end1937 tmux.send_keys :Space1938 tmux.until { |lines| assert lines.any_include?('bar') }1939 end1940
65 unmodified lines