alternate match colors when matches are adjacent #2679
Replies: 1 comment
-
I'm going to pass on this one. It sounds like a nice idea, and I don't necessarily disagree that it is, but if you sit down and think about how it might be implemented, it's pretty complex. Users will absolutely demand some kind of control over which colors are used, and that will complicate the UX. There's also the possibility that end users won't understand what the different colors mean, and might think there is some significance to them. That might in turn imply that this needs to be a non-default opt-in feature, which reduces its effectiveness somewhat since you need to know to opt into it. One thing worth mentioning here is that if you are confused about how ripgrep comes up with the match it does, you can pass the |
Beta Was this translation helpful? Give feedback.
-
I was in the process of iteratively building out a regex to match an IPv4 address, and even before I added repetition, I noticed rg already seemed to match against three of the four segments of IPv4.
rg '\d+\.'
This momentarily confused me, until I realized these were three separate side by side matches.
Perhaps ripgrip could introduce alternate colors when two matches are side by side?
I think that would be a nice feature.
thanks!
Beta Was this translation helpful? Give feedback.
All reactions