Permalink
Browse files

Listening mouseup for single click! an less presure for on_selection_…

…modified
  • Loading branch information...
titoBouzout committed Jan 8, 2012
1 parent 3a07c84 commit fbf781f8485faa4a679e8aa036c9462707d0c9d5
Showing with 25 additions and 8 deletions.
  1. +7 −2 Default (Linux).sublime-mousemap
  2. +7 −2 Default (OSX).sublime-mousemap
  3. +7 −2 Default (Windows).sublime-mousemap
  4. +4 −2 word_highlight.py
@@ -4,12 +4,17 @@
"button": "button1", "count": 2,
"press_command": "drag_select",
"press_args": {"by": "words"},
- "command": "word_highlight_double_click"
+ "command": "word_highlight_click"
},
{
"button": "button1", "count": 2, "modifiers": ["ctrl"],
"press_command": "drag_select",
"press_args": {"by": "words", "additive": true},
- "command": "word_highlight_double_click"
+ "command": "word_highlight_click"
+ },
+ {
+ "button": "button1", "count": 1,
+ "press_command": "drag_select",
+ "command": "word_highlight_click"
}
]
@@ -4,12 +4,17 @@
"button": "button1", "count": 2,
"press_command": "drag_select",
"press_args": {"by": "words"},
- "command": "word_highlight_double_click"
+ "command": "word_highlight_click"
},
{
"button": "button1", "count": 2, "modifiers": ["super"],
"press_command": "drag_select",
"press_args": {"by": "words", "additive": true},
- "command": "word_highlight_double_click"
+ "command": "word_highlight_click"
+ },
+ {
+ "button": "button1", "count": 1,
+ "press_command": "drag_select",
+ "command": "word_highlight_click"
}
]
@@ -4,12 +4,17 @@
"button": "button1", "count": 2,
"press_command": "drag_select",
"press_args": {"by": "words"},
- "command": "word_highlight_double_click"
+ "command": "word_highlight_click"
},
{
"button": "button1", "count": 2, "modifiers": ["ctrl"],
"press_command": "drag_select",
"press_args": {"by": "words", "additive": true},
- "command": "word_highlight_double_click"
+ "command": "word_highlight_click"
+ },
+ {
+ "button": "button1", "count": 1,
+ "press_command": "drag_select",
+ "command": "word_highlight_click"
}
]
View
@@ -51,12 +51,14 @@ def run(self, edit):
for w in wh:
self.view.sel().add(w)
-class WordHighlightDoubleClickCommand(sublime_plugin.TextCommand):
+
+class WordHighlightClickCommand(sublime_plugin.TextCommand):
def run(self, edit):
view = self.view
if Pref.enabled and not view.settings().get('is_widget'):
WordHighlightListener().highlight_occurences(view)
+
class WordHighlightListener(sublime_plugin.EventListener):
def on_activated(self, view):
@@ -69,7 +71,7 @@ def on_activated(self, view):
def on_selection_modified(self, view):
if Pref.enabled and not view.settings().get('is_widget'):
now = time.time()
- if now - Pref.timing > 0.06:
+ if now - Pref.timing > 0.08:
Pref.timing = now
self.highlight_occurences(view)
else:

0 comments on commit fbf781f

Please sign in to comment.