-
Notifications
You must be signed in to change notification settings - Fork 60
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
Only last instance of repeated pattern gets coloured #115
Comments
This could be by design. If you use outer parentheses, it works better:
This reveals a separate issue, namely extraneous text added (i.e., "[test]t"). I'm in the course of documenting that. |
@tomasohara Thanks for looking into this. I had already tried your idea of using outer parentheses, but unfortunately the extraneous text made it unusable for what I needed to do. I don't think there's an issue for this, but it is mentioned on the main page under Limitations ("Don't use nested groups"). |
This seem tricky to fix, given that groups have two meanings for colout (one for regexp, one for coloring). |
@nojhan How about parsing the input string to find the outer groups? For example, given |
I unfortunately don't have time for this in a near future, but I am open to merging a pull request that would do that. |
@nojhan I thought about it and came up with an idea that's even simpler than parsing the input string: just let the user do it on the command line through another argument. This has the additional advantage of generally addressing your above point that "groups have two meanings for colout (one for regexp, one for coloring)", because now the user can decide which is which. I made a pull request (#117) but I don't know Python so it will surely need tweaking; I used a global variable when I got stuck, but otherwise it seems to work as expected. |
I tried this example from the docs:
and noticed that in a permission string like
-rw-r--r--
, only the last three characters were yellow, when I think we would expect the last nine characters (i.e., everything following the initial-
) to be yellow.For a simpler example:
Here the final
t
is red, even though the match is really all four characters oftest
.The text was updated successfully, but these errors were encountered: