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

Colour - Support Highlighting when Ungronning from grep. #110

Open
stellarpower opened this issue Jun 11, 2023 · 0 comments
Open

Colour - Support Highlighting when Ungronning from grep. #110

stellarpower opened this issue Jun 11, 2023 · 0 comments

Comments

@stellarpower
Copy link

image

Removal of ANSI escape codes was discussed in #47, as these cause parse errors.

I'd like to highlight one area where they're very useful - when using coloured output from grep to highlight incidents of the search term. When grepping for plain text, it's a very useful feature, especially if the input lines are very long, as it makes it easy to find the actual pattern within that text.

Gron's colour output when ungronning is nice, and makes JSON easy to scan, but I'd like to suggest adding the ability to colourise the search term within that output so that it is also easy to see it in the subset that is returned from a search:

image

If it would be possible to parse the input properly when it includes escape codes in it (I don't know if some corner cases mean this could break things), and a boolean flag indicating the portion of the input that is the search result when escape codes are seen, and then colourise the portions of the output in a similar way, I think that would be a potential way to implement this, and help make gron quicker to use.

Thanks!!

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