mirror of
https://github.com/junegunn/fzf.git
synced 2026-04-28 01:55:37 +08:00
Redraw when change-footer changes line count
Mirror of the earlier change-header fix. The inline footer slot's row budget depends on footer content length, but resizeIfNeeded() tolerates a shorter-than-wanted inline window, so extra lines get clipped. Drive a redraw on length change to re-run the layout.
This commit is contained in:
+13
-1
@@ -1534,12 +1534,24 @@ class TestLayout < TestInteractive
|
||||
def test_inline_change_header_grows_slot
|
||||
tmux.send_keys %(seq 5 | #{FZF} --style full --header-lines 1 --header-border inline --bind space:change-header:tada), :Enter
|
||||
tmux.until { |lines| lines.any_include?(/\A│\s+1\s+│\z/) }
|
||||
tmux.send_keys ' '
|
||||
tmux.send_keys :Space
|
||||
tmux.until do |lines|
|
||||
lines.any_include?(/\A│\s+1\s+│\z/) && lines.any_include?(/\A│\s+tada\s+│\z/)
|
||||
end
|
||||
end
|
||||
|
||||
# Regression: with --footer-border=inline, change-footer that grows the
|
||||
# footer line count left the inline slot sized for the old length, so
|
||||
# extra lines were clipped.
|
||||
def test_inline_change_footer_grows_slot
|
||||
tmux.send_keys %(seq 5 | #{FZF} --style full --footer-border inline --footer one --bind $'space:change-footer:one\\ntwo'), :Enter
|
||||
tmux.until { |lines| lines.any_include?(/\A│\s+one\s+│\z/) }
|
||||
tmux.send_keys :Space
|
||||
tmux.until do |lines|
|
||||
lines.any_include?(/\A│\s+one\s+│\z/) && lines.any_include?(/\A│\s+two\s+│\z/)
|
||||
end
|
||||
end
|
||||
|
||||
# Invalid inline combinations must be rejected at startup.
|
||||
def test_inline_rejected_on_unsupported_options
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user