SublimeText / WordHighlight

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

Highlight should use different colors when using multiple selections #44

Open titoBouzout opened 11 years ago

titoBouzout commented 11 years ago

It would be very nice, to use different colours when using this package with multiples words. I'll try to take a look

adzenith commented 11 years ago

The only annoying thing is that all colors have to come from the color scheme, so this could be difficult.

titoBouzout commented 11 years ago

The only difficult thing in life is to get jon to reply to messages/forums post, bugs, programming things can be solved.

titoBouzout commented 11 years ago

:P

titoBouzout commented 11 years ago

I've an inexplicable frustration..

adzenith commented 11 years ago

Haha I find it easily explicable... I've the same one :)

FichteFoll commented 11 years ago
  1. A list with all the default scopes (like constant, string ...) and wrapping it should be sufficient.
  2. Yes, some words about potential future features woule be really nice. Even a word of decline is better than nothing.
titoBouzout commented 11 years ago

Relevant: http://www.sublimetext.com/forum/viewtopic.php?f=2&t=12418

adzenith commented 10 years ago

There's a list of the 11 "root groups" here: http://manual.macromates.com/en/language_grammars

adzenith commented 10 years ago

['comment', 'constant', 'entity', 'invalid', 'keyword', 'markup', 'meta', 'storage', 'string', 'support', 'variable'], but maybe we wouldn't want to use "invalid".

Do people still use this plugin?

FichteFoll commented 10 years ago

Excluding meta, because that's actually not supposed to be colored but more of an internal thing, so we have 10 available colors. (I use it a lot for AAAPackageDev auto completion because I can use the regex parsing of the file from the syntax definition instead of parsing stuff yet again.) Also, some color schemes only define invalid.deprecated and invalid.illegal but not illegal itself.

I don't think I ever used this plugin, but the issues are quite active I guess.

bryan-lott commented 9 years ago

You could do highlighting similar to Colorcoder and hash the word underneath the cursor to determine its color. And, to retain the current functionality, only do it if there are multiple selections.

adzenith commented 9 years ago

ColorCoder modifies the color scheme file to add other colors. I guess we could do the same? ...Could you just use ColorCoder? :stuck_out_tongue:

facelessuser commented 9 years ago

I've never used this plugin, but I was looking through the groups issues today and saw this. I personally use a custom word highlighter that I picked up on the forums a long time ago and heavily modified it. I've never released it, but it supports multi selections. I keep it in my bin of plugins I don't care to publicly support https://github.com/facelessuser/SublimeRandomCrap/blob/master/highlight_word.py.

I personally wanted to easily be able to specify multi-selections so at any time I could have as many or few as I wanted. So I made it dynamic in the settings:

    // Define scopes for highlights
    // The more you define, the more selections you can do
    "highlight_scopes": ["string", "keyword", "constant.language"],

Anyways, maybe this will spark some ideas. I have no objections of anyone snagging code or ideas from it, but I was not the original author and I don't think there was ever a license associated with it...so whatever that means. Just figured I'd throw something at this as it's been open for years :smile:.