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

ripgrep match styling not detected by emacs #570

Closed
tspiteri opened this issue Jul 29, 2017 · 2 comments
Closed

ripgrep match styling not detected by emacs #570

tspiteri opened this issue Jul 29, 2017 · 2 comments

Comments

@tspiteri
Copy link

tspiteri commented Jul 29, 2017

Emacs seems to be matching a particular ANSI pattern in grep.el to be able to jump directly to the match in a line, using the pattern "\033\\[0?1;31m\\(.*?\\)\033\\[[0-9]*m". This works for GNU grep which styles the match using "\x1b[01;31m", but not for rg which styles the match using "\x1b[31m\x1b[1m".

Note: As a workaround, I wrapped rg with a script:

#!/bin/sh
rg --color ansi -nH --no-heading "$@" | sed 's/\o033\[31m\o033\[1m/\o033[1;31m/g'
@okdana
Copy link
Contributor

okdana commented Jul 30, 2017

Related? #244 (comment)

@BurntSushi
Copy link
Owner

I don't think it's reasonable to expect that ripgrep's ANSI styling matches grep's ANSI styling byte-for-byte. Your work-around seems fine to me?

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

3 participants