Skip to content

Commit 3f709e6

Browse files
author
DisposaBoy
committed
* track mouse clicks globally
1 parent a1bafc3 commit 3f709e6

4 files changed

+19
-15
lines changed

Default (Linux).sublime-mousemap

+3-5
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
"button": "button1",
44
"modifiers": ["ctrl", "shift"],
55
"press_command": "drag_select",
6-
"command": "gs_doc",
7-
"args": {"mode": "goto"}
6+
"command": "gs_on_left_click"
87
},
98
{
109
"button": "button2",
1110
"modifiers": ["ctrl", "shift"],
1211
"press_command": "drag_select",
13-
"command": "gs_doc",
14-
"args": {"mode": "hint"}
12+
"command": "gs_on_right_click"
1513
}
16-
]
14+
]

Default (OSX).sublime-mousemap

+3-5
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
"button": "button1",
44
"modifiers": ["super", "shift"],
55
"press_command": "drag_select",
6-
"command": "gs_doc",
7-
"args": {"mode": "goto"}
6+
"command": "gs_on_left_click"
87
},
98
{
109
"button": "button2",
1110
"modifiers": ["super", "shift"],
1211
"press_command": "drag_select",
13-
"command": "gs_doc",
14-
"args": {"mode": "hint"}
12+
"command": "gs_on_right_click"
1513
}
16-
]
14+
]

Default (Windows).sublime-mousemap

+3-5
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
"button": "button1",
44
"modifiers": ["ctrl", "shift"],
55
"press_command": "drag_select",
6-
"command": "gs_doc",
7-
"args": {"mode": "goto"}
6+
"command": "gs_on_left_click"
87
},
98
{
109
"button": "button2",
1110
"modifiers": ["ctrl", "shift"],
1211
"press_command": "drag_select",
13-
"command": "gs_doc",
14-
"args": {"mode": "hint"}
12+
"command": "gs_on_right_click"
1513
}
16-
]
14+
]

gsev.py

+10
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ def on_post_save(self, view):
1212
def on_activated(self, view):
1313
sublime.set_timeout(lambda: do_sync_active_view(view), 0)
1414

15+
class GsOnLeftClick(sublime_plugin.TextCommand):
16+
def run(self, edit):
17+
if gs.is_go_source_view(self.view):
18+
self.view.run_command('gs_doc', {"mode": "goto"})
19+
20+
class GsOnRightClick(sublime_plugin.TextCommand):
21+
def run(self, edit):
22+
if gs.is_go_source_view(self.view):
23+
self.view.run_command('gs_doc', {"mode": "hint"})
24+
1525
def do_post_save(view):
1626
if not gs.is_pkg_view(view):
1727
return

0 commit comments

Comments
 (0)