mirror of
https://github.com/junegunn/fzf.git
synced 2026-02-05 17:37:54 +08:00
Fix coloring of items with zero-width characters
This commit fixes incorrect coloring for items that contain zero-width characters. It also makes ellipsis coloring consistent when text is trimmed from either the left or the right. Fix #4620 Close #4646
This commit is contained in:
@@ -2175,4 +2175,13 @@ class TestCore < TestInteractive
|
||||
assert_equal 1, it.match_count
|
||||
end
|
||||
end
|
||||
|
||||
def test_zero_width_characters
|
||||
tmux.send_keys %(for i in {1..1000}; do string+="a̱$i"; printf '\\e[43m%s\\e[0m\\n' "$string"; done | #{FZF} --ansi --query a500 --ellipsis XX), :Enter
|
||||
tmux.until do |lines|
|
||||
assert_equal 981, lines.match_count
|
||||
assert_match(/^> XX.*a̱500/, lines[-3])
|
||||
assert(lines.reverse.drop(5).all? { it.match?(/^ XX.*a̱500.*XX/) })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user