seanliang/HighlightWords — pull request #11 by liuhewei (2014-11-08 04:56:25+00:00)
Title: features include: choose word on cursor, support "whole word", clear wor...

...d list when press 'esc'

These features are good for me. I submit this PR assuming that some guys might have the same requirements with me, and for your consideration if you want to do the same thing.

1. Choose word on cursor automatically: https://github.com/liuhewei/HighlightWords/blob/master/HighlightWords.py#L26
2. Support only highlighting the whole words rather than the substrings:
`PS`: Not an elegant one because this implementation depends on Regex, but very simple one I think.
https://github.com/liuhewei/HighlightWords/blob/master/HighlightWords.py#L31
3. Clear word automatically when escape from the input panel, or un-highlight current one:
`PS`: I noticed that you has implemented the "on_cancel" method, but why not use it? Maybe you think highlighting words should be also effective when closing input panel, but if so, I suggest do not prompt the input panel: add a configure item for showing input panel or not when highlighting words. It's better to let user to choose the way of usage. (and also it's easy to implement:))
https://github.com/liuhewei/HighlightWords/blob/master/HighlightWords.py#L49