SublimeText / WordHighlight

Highlight all copies of the currently selected word.
MIT License
179 stars 24 forks source link

Foreground color of selected word - Visibility issue #77

Open ckm2k1 opened 6 years ago

ckm2k1 commented 6 years ago

image

With the latest sublime changes to color schemes and how the default coloring works, you can see in the image the word selected using something like cmd+d or a plain selection, uses black foreground text by default which makes it really hard to see the selected word.

I've made a tiny patch in word_highlight.py to sort this out. I'm not sure it'll be a good solution for everyone, but it essentially fixes the issue to behave like it did before the recent sublime update.

The fix simply drops any selections from the list of regions found by find_regions(). word_highlight.py:237, replace return regions with:

return [region for region in regions if not view.sel().contains(region)]

The result: image

I can make a PR if this is an acceptable solution.