SublimeText / WordHighlight

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

Improvements #22

Closed titoBouzout closed 12 years ago

titoBouzout commented 12 years ago

This merge add a lot of Improvements on performance for different cases and fix some little things.

Please instead of looking at the whole diff. take a look to each commit individually. Each of these contain a descriptive message.

I'll merge this request because adzenith is on vacation and the improvements are huge.

titoBouzout commented 12 years ago

Merging please read item0

titoBouzout commented 12 years ago

For some reason I can't reopen this issue. I want to keep it open until adzenith read it

adzenith commented 12 years ago

I looked briefly through the commits and things look great! Thanks for all your hard work. :)

titoBouzout commented 12 years ago

Thanks for reviewing adzenith,

I apply changes to the number until feels right. I think there is no need to customize this number, it just control: run "highlight_occurences" if at least 0.06 sec has been passed.

A comment about this --

"on_selection_modified" /was/ the way to listening for words.

Now there is the "click" and "double click" listener, then, there is no real need to use "on_selection_modified"

I think this listener should be disabled by default via a preference ( to remove the pressure when the user selected text by dragging )

Right now, "on_selection_modified" is only useful to Highlight a word, when the word is "selected by dragging"( in a slow manner without releasing the click of the mouse ). When clicking or double-clicking WordHighlightClickCommand is dispatched in an instant.

What do you think about adding a preference "find_for_words_when_selecting" with default value to false?

I don't know if I were clear!

adzenith commented 12 years ago

I commented over on the new pull request, but I may as well also put it here: I select words with the keyboard the majority of the time, so I'd like to keep the on_selection_modified by default. I think that way the behaviour of the plugin is also potentially less confusing. What do you think? Also I won't have internet again for at least the next five days. Thanks!