mirror of
https://github.com/junegunn/fzf.git
synced 2026-02-21 09:08:40 +08:00
Fix missing wrap sign at ANSI color boundary
This commit is contained in:
@@ -582,4 +582,31 @@ class TestPreview < TestInteractive
|
||||
assert_equal 1, lines.match_count
|
||||
end
|
||||
end
|
||||
|
||||
def test_preview_wrap_sign_between_ansi_fragments
|
||||
tmux.send_keys %(seq 1 | #{FZF} --preview 'echo -e "\\x1b[33m1234567890 \\x1b[mhello"; echo -e "\\x1b[33m1234567890 \\x1b[mhello"' --preview-window 10,wrap-word), :Enter
|
||||
tmux.until do |lines|
|
||||
assert_equal 1, lines.match_count
|
||||
assert_equal 2, lines.count { |line| line.include?('│ 1234567890 │') }
|
||||
assert_equal 2, lines.count { |line| line.include?('│ ↳ hello │') }
|
||||
end
|
||||
end
|
||||
|
||||
def test_preview_wrap_sign_between_ansi_fragments_overflow
|
||||
tmux.send_keys %(seq 1 | #{FZF} --preview 'echo -e "\\x1b[33m1234567890 \\x1b[mhello"; echo -e "\\x1b[33m1234567890 \\x1b[mhello"' --preview-window 2,wrap-word), :Enter
|
||||
tmux.until do |lines|
|
||||
assert_equal 1, lines.match_count
|
||||
assert_equal 2, lines.count { |line| line.include?('│ 12 │') }
|
||||
assert_equal 0, lines.count { |line| line.include?('│ h') }
|
||||
end
|
||||
end
|
||||
|
||||
def test_preview_wrap_sign_between_ansi_fragments_overflow2
|
||||
tmux.send_keys %(seq 1 | #{FZF} --preview 'echo -e "\\x1b[33m1234567890 \\x1b[mhello"; echo -e "\\x1b[33m1234567890 \\x1b[mhello"' --preview-window 1,wrap-word), :Enter
|
||||
tmux.until do |lines|
|
||||
assert_equal 1, lines.match_count
|
||||
assert_equal 2, lines.count { |line| line.include?('│ 1 │') }
|
||||
assert_equal 0, lines.count { |line| line.include?('│ h') }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user