m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 00:03:39 -05:00

Should not strip ANSI codes when --ansi is not set

This commit is contained in:
Junegunn Choi
2015-08-28 21:23:10 +09:00
parent 698e8008df
commit 90b0cd44ac
4 changed files with 22 additions and 10 deletions

View File

@@ -784,6 +784,12 @@ class TestGoFZF < TestBase
assert_equal 'hello world ', `cat #{tempname} | #{FZF} -f"^he hehe" -x -n 2.. --with-nth 2,1,1 --ansi`.chomp
end
def test_with_nth_no_ansi
src = "\x1b[33mhello \x1b[34;1mworld\x1b[m "
writelines tempname, [src, 'byebye']
assert_equal src, `cat #{tempname} | #{FZF} -fhehe -x -n 2.. --with-nth 2,1,1 --no-ansi`.chomp
end
private
def writelines path, lines
File.unlink path while File.exists? path