Skip to content

Commit a588965

Browse files
committed
Fix the bug that goto keymap function isn't work.
1 parent 6fc16e6 commit a588965

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

erl_autocompletion.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,15 @@ def on_query_completions(self, view, prefix, locations):
5757
return ([], sublime.INHIBIT_EXPLICIT_COMPLETIONS)
5858

5959
def on_text_command(self, view, command_name, args):
60-
if command_name == 'goto' and 'event' in args:
61-
event = args['event']
62-
point = view.window_to_text((event['x'], event['y']))
63-
60+
if command_name == 'goto':
61+
if args and 'event' in args:
62+
event = args['event']
63+
point = view.window_to_text((event['x'], event['y']))
64+
else:
65+
sels = view.sel()
66+
point = sels[0].begin()
67+
68+
print(point)
6469
if not view.match_selector(point, "source.erlang"):
6570
return
6671

0 commit comments

Comments
 (0)