diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2025-10-04 20:06:58 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2025-10-04 21:56:56 +0900 |
| commit | febaadbee5b896928664449d7f7c3c6fe2220e26 (patch) | |
| tree | c6cbbc57262bee6ed7bb18f41c3d3f12180ce2a0 /test | |
| parent | 0e67c5aa7a7c98bc9c8b0f8bed23579136db54da (diff) | |
| download | fzf-febaadbee5b896928664449d7f7c3c6fe2220e26.tar.gz | |
Fix stray character artifacts when scrollbar is hidden
Fix #4537
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_layout.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/test_layout.rb b/test/test_layout.rb index db04c044..56d944cf 100644 --- a/test/test_layout.rb +++ b/test/test_layout.rb @@ -1192,6 +1192,29 @@ class TestLayout < TestInteractive tmux.until { assert_block(block, it) } end + # https://github.com/junegunn/fzf/issues/4537 + def test_no_scrollbar_preview_toggle + x = 'x' * 300 + y = 'y' * 300 + tmux.send_keys %(yes #{x} | head -1000 | fzf --bind 'tab:toggle-preview' --border --no-scrollbar --preview 'echo #{y}' --preview-window 'border-left'), :Enter + + # │ ▌ xxxxxxxx·· │ yyyyyyyy│ + tmux.until do |lines| + lines.any? { it.match?(/x·· │ y+│$/) } + end + tmux.send_keys :Tab + + # │ ▌ xxxxxxxx·· │ + tmux.until do |lines| + lines.none? { it.match?(/x··y│$/) } + end + + tmux.send_keys :Tab + tmux.until do |lines| + lines.any? { it.match?(/x·· │ y+│$/) } + end + end + def test_combinations skip unless ENV['LONGTEST'] |
