Permalink
Browse files

Apply changes from commmnts in #33

  • Loading branch information...
1 parent 75de93c commit 232e208b1760a4bdcba9598c6e78b0d0fd20162d @titoBouzout titoBouzout committed Sep 11, 2012
Showing with 19 additions and 18 deletions.
  1. +13 −13 README.markdown
  2. +4 −3 Word Highlight.sublime-settings
  3. +2 −2 word_highlight.py
View
@@ -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.
-
+
<dict>
<key>name</key>
<string>WordHighlight</string>
@@ -74,10 +74,10 @@ Under the Packages/WordHighlight sub-directory, edit the `Word Highlight.sublime
</dict>
* `"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
@@ -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,
View
@@ -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)

0 comments on commit 232e208

Please sign in to comment.