Skip to content

Commit c3c081e

Browse files
committed
Def: Follow symbolic links and change key to no longer collide with 'Open Package'. Merge branch 'sleetdrop/godef-follow-symbolic-link'
2 parents 9477935 + 0736e29 commit c3c081e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Commands/Def.tmCommand

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
require ENV['TM_SUPPORT_PATH'] + '/lib/textmate'
1111
require ENV['TM_SUPPORT_PATH'] + '/lib/tm/process'
1212
require ENV['TM_SUPPORT_PATH'] + '/lib/tm/save_current_document'
13+
require 'pathname'
1314
1415
# TextMate's special TM_GODEF or expect 'godef' on PATH
1516
godef_cmd = ENV['TM_GODEF'] || 'godef'
@@ -37,7 +38,8 @@ out, err = TextMate::Process.run(*args)
3738
3839
if err.nil? || err == ''
3940
file_details = out.split(':')
40-
TextMate.go_to(:file => file_details[0],
41+
file = Pathname.new(file_details[0]).realpath
42+
TextMate.go_to(:file => file,
4143
:line => file_details[1],
4244
:column => file_details[2].to_i)
4345
elsif err.casecmp "godef: no identifier found";
@@ -52,7 +54,7 @@ end</string>
5254
<key>inputFormat</key>
5355
<string>text</string>
5456
<key>keyEquivalent</key>
55-
<string>@D</string>
57+
<string>^.</string>
5658
<key>name</key>
5759
<string>Go to Definition</string>
5860
<key>outputCaret</key>

0 commit comments

Comments
 (0)