JazzCore / ctrlp-cmatcher

CtrlP C matching extension
BSD 2-Clause "Simplified" License
207 stars 22 forks source link

Improve highlighting #8

Closed aaronjensen closed 11 years ago

aaronjensen commented 11 years ago

Hopefully addresses #7 I only changed the regular highlighting, I haven't tested the other versions.

There are a couple of whitespace changes in there as well, if that's OK, let me know

JazzCore commented 11 years ago

Right, i see the difference. It's clearly better, but it's a bit confusing in some cases, e.g. if i search for oost in a path like cpp/BoostParts/boost/algorightm it will highlight only first match in BoostParts and will skip the next match in boost.

Is there a way to improve it?

aaronjensen commented 11 years ago

i have some ideas...

aaronjensen commented 11 years ago

ok, this is quite a bit more complicated, but it will match only the last-most occurrence. It's not perfect, like if you search for foouser it's not smart enough to highlight foo/group_user perfectly (the u in group will be highlit instead of the u in user) but it's pretty darn good.

JazzCore commented 11 years ago

This is nice. Just 2 more simple requests: please make it case insensitive (currently search for boost does not highlight Boost correctly) and please add some generic comments in code about regexps and it will be good to merge.

aaronjensen commented 11 years ago

Ok, give it a look. The regexp is still pretty complicated, but hopefully the comments shed some light.

aaronjensen commented 11 years ago

also let me know if you want me to squash these into one commit

JazzCore commented 11 years ago

Awesome, big thanks for the contribution! I've merged it but forgot to add close message for this PR, so closing it manually. Thanks again!