diff --git a/README.markdown b/README.markdown index f9208c1..900ca3d 100644 --- a/README.markdown +++ b/README.markdown @@ -17,7 +17,7 @@ Go to your Packages subdirectory under ST2's data directory: Then clone this repository: git clone git://github.com/SublimeText/WordHighlight.git - + That's it! Options @@ -26,41 +26,41 @@ Options Under the Packages/WordHighlight sub-directory, edit the `Word Highlight.sublime-settings` file: * `"draw_outlined" : true` - + This makes the highlights be drawn as outlines instead of as filled highlights. -* `"marking_occurrences_on_gutter" : true` +* `"mark_occurrences_on_gutter" : true` If this comes true, icons will be used to mark all occurrences of selected words on the gutter bar. To customize the icons, the property "icon_type_on_gutter" is helpful. - + * `"icon_type_on_gutter" : dot` - + Normally, there are 4 valid types: dot, circle, bookmark and cross. If you want more, please have a look at folder "Theme - Default" under the "Packages" of Sublime Text (this can be done via menu "Preferences > Browse Packages"). * `"highlight_when_selection_is_empty" : true` - + This makes words highlight when the insertion point is inside of them but when they're not actually selected. * `"highlight_word_under_cursor_when_selection_is_empty" : true` - + When the previous option is enabled, this makes the word under the cursor to gain highlighting * `"highlight_delay" : 0` - - This delays highlighting all occurrences using given time (in miliseconds) to let users move cursor + + This delays highlighting all occurrences using given time (in miliseconds) to let users move cursor around without being distracted with immediate highlights. Default value 0 means almost no delay. * `"color_scope_name" : "wordhighlight"` - + Normally the color of the highlights is the same as the color of comments in your code. If you'd like to customize the color, add the below to your color scheme file and change EDF2E9 to whatever color you want, then change color_scope_name to the scope name in the block you added. - + name WordHighlight @@ -74,10 +74,10 @@ Under the Packages/WordHighlight sub-directory, edit the `Word Highlight.sublime * `"file_size_limit" : 4194304` - + Files bigger than this number will put WordHighlight on mode "highlight around view port" (a portion of the document) * `"when_file_size_limit_search_this_num_of_characters" : 20000` - + When a file is bigger than the previous setting. This controls how many characters below and above the view port you want to search for words to highlight diff --git a/Word Highlight.sublime-settings b/Word Highlight.sublime-settings index 58e159e..677d2b3 100644 --- a/Word Highlight.sublime-settings +++ b/Word Highlight.sublime-settings @@ -2,9 +2,10 @@ "color_scope_name": "comment", "case_sensitive": true, "draw_outlined": true, - "marking_occurrences_on_gutter" : true, - // valid types: dot, circle, bookmark and cross - "icon_type_on_gutter" : "dot", + + "mark_occurrences_on_gutter" : false, + // valid types: dot, circle, bookmark and cross + "icon_type_on_gutter" : "dot", "highlight_delay": 0, "highlight_when_selection_is_empty": false, diff --git a/word_highlight.py b/word_highlight.py index 17f15fc..cc62a42 100755 --- a/word_highlight.py +++ b/word_highlight.py @@ -15,7 +15,7 @@ def load(self): Pref.highlight_delay = settings.get('highlight_delay', 0) Pref.case_sensitive = (not bool(settings.get('case_sensitive', True))) * sublime.IGNORECASE Pref.draw_outlined = bool(settings.get('draw_outlined', True)) * sublime.DRAW_OUTLINED - Pref.marking_occurrences_on_gutter = bool(settings.get('marking_occurrences_on_gutter', True)) + Pref.mark_occurrences_on_gutter = bool(settings.get('mark_occurrences_on_gutter', False)) Pref.icon_type_on_gutter = settings.get("icon_type_on_gutter", "dot") Pref.highlight_when_selection_is_empty = bool(settings.get('highlight_when_selection_is_empty', False)) Pref.highlight_word_under_cursor_when_selection_is_empty = bool(settings.get('highlight_word_under_cursor_when_selection_is_empty', False)) @@ -129,7 +129,7 @@ def highlight_occurences(self, view): view.erase_regions("WordHighlight") if regions: if Pref.highlight_delay == 0: - view.add_regions("WordHighlight", regions, Pref.color_scope_name, Pref.icon_type_on_gutter if Pref.marking_occurrences_on_gutter else "", Pref.draw_outlined) + view.add_regions("WordHighlight", regions, Pref.color_scope_name, Pref.icon_type_on_gutter if Pref.mark_occurrences_on_gutter else "", Pref.draw_outlined) view.set_status("WordHighlight", ", ".join(list(set(occurrencesMessage))) + (' found on a limited portion of the document ' if limited_size else '')) else: sublime.set_timeout(lambda:self.delayed_highlight(view, regions, occurrencesMessage, limited_size), Pref.highlight_delay)