Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect result display with empty line and colors #599

Closed
roblourens opened this issue Sep 6, 2017 · 0 comments
Closed

Incorrect result display with empty line and colors #599

roblourens opened this issue Sep 6, 2017 · 0 comments

Comments

@roblourens
Copy link
Contributor

microsoft/vscode#31252

When I search ^$, I get, for each file, a correctly formatted result line for the first empty line in the file, but the other result lines have extra color escape codes for a 'match' before the line number.

The command I'm using to demonstrate is rg --color ansi --colors 'path:none' --colors 'line:none' --colors 'match:fg:red' --colors 'match:style:nobold' --heading --line-number '^$' > out.txt - the extra --colors flags are not necessary to the repro, they just make it a little easier to see the issue. And this might be a good time to ask whether you've made any progress towards #244 😁

Result

^[[mtest.txt^[[m
^[[m2^[[m:^[[m^[[31m^[[m
^[[m^[[31m^[[m^[[m4^[[m:^[[m^[[31m^[[m
^[[m^[[31m^[[m^[[m6^[[m:^[[m^[[31m^[[m
^[[m^[[31m^[[m^[[m8^[[m:^[[m^[[31m^[[m

You can see the first line starts with the 2: surrounded by escapes. But other lines first have escape codes for a match, then 4:, then another set of codes for a match.

Expected:
I search another file for ^foo$.

^[[mtest2.txt^[[m
^[[m2^[[m:^[[m^[[31mfoo^[[m
^[[m4^[[m:^[[m^[[31mfoo^[[m
^[[m6^[[m:^[[m^[[31mfoo^[[m
^[[m8^[[m:^[[m^[[31mfoo^[[m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant