Permalink
Browse files
Listening mouseup for single click! an less presure for on_selection_…
- Loading branch information...
|
@@ -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"
|
|
|
}
|
|
|
]
|
|
@@ -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