mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-16 07:13:48 -05:00
Add --freeze-right=N option to keep the rightmost N fields visible
This commit is contained in:
@@ -1201,6 +1201,33 @@ class TestCore < TestInteractive
|
||||
tmux.until { |lines| assert lines.any_include?('1␊2␊3␊4␊5␊') }
|
||||
end
|
||||
|
||||
def test_freeze_left_and_right
|
||||
tmux.send_keys %[seq 10000 | tr "\n" ' ' | #{FZF} --freeze-left 3 --freeze-right 3 --ellipsis XX], :Enter
|
||||
tmux.until { |lines| assert_match(/XX9998 9999 10000$/, lines[-3]) }
|
||||
tmux.send_keys "'1000"
|
||||
tmux.until { |lines| assert_match(/^> 1 2 3XX.*XX9998 9999 10000$/,lines[-3]) }
|
||||
end
|
||||
|
||||
def test_freeze_right_exceed_range
|
||||
tmux.send_keys %[seq 10000 | tr "\n" ' ' | #{FZF} --freeze-right 100000 --ellipsis XX], :Enter
|
||||
['', "'1000"].each do |query|
|
||||
tmux.send_keys query
|
||||
tmux.until { |lines| assert lines.any_include?("> #{query}".strip) }
|
||||
tmux.until do |lines|
|
||||
assert_match(/ 9998 9999 10000$/, lines[-3])
|
||||
assert_equal(1, lines[-3].scan('XX').size)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def test_freeze_right_exceed_range_with_freeze_left
|
||||
tmux.send_keys %[seq 10000 | tr "\n" ' ' | #{FZF} --freeze-left 3 --freeze-right 100000 --ellipsis XX], :Enter
|
||||
tmux.until do |lines|
|
||||
assert_match(/^> 1 2 3XX.*9998 9999 10000$/, lines[-3])
|
||||
assert_equal(1, lines[-3].scan('XX').size)
|
||||
end
|
||||
end
|
||||
|
||||
def test_backward_eof
|
||||
tmux.send_keys "echo foo | #{FZF} --bind 'backward-eof:reload(seq 100)'", :Enter
|
||||
tmux.until { |lines| lines.item_count == 1 && lines.match_count == 1 }
|
||||
|
||||
Reference in New Issue
Block a user