diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2023-03-17 13:22:20 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2023-03-17 13:22:20 +0900 |
commit | 3c34dd82750ca61a1ee7f329ed47fe01e6d1ee30 (patch) | |
tree | e4dc57758beef8aea12a866de253a2ff088091d5 /test | |
parent | 1116e481bef4f63abe0e506ce20469e244c505e6 (diff) |
Fix extra new line in the preview window
When a colored text ends at the right end of the window
Fix #3209
Diffstat (limited to 'test')
-rwxr-xr-x | test/test_go.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test_go.rb b/test/test_go.rb index 6ef2d62c..07a7c195 100755 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -2656,6 +2656,23 @@ class TestGoFZF < TestBase tmux.send_keys :Enter tmux.until { |lines| assert_equal 99, lines.item_count } end + + def test_no_extra_newline_issue_3209 + tmux.send_keys(%(seq 100 | #{FZF} --height 10 --preview-window up,wrap --preview 'printf "─%.0s" $(seq 1 "$((FZF_PREVIEW_COLUMNS - 5))"); printf $"\\e[7m%s\\e[0m" title; echo; echo something'), :Enter) + expected = <<~OUTPUT + ╭────────── + │ ───────── + │ something + │ + ╰────────── + 3 + 2 + > 1 + 100/100 ─ + > + OUTPUT + tmux.until { assert_block(expected, _1) } + end end module TestShell |