Created
January 25, 2016 18:30
-
-
Save andyperlitch/08c4ef2979a146169d9f to your computer and use it in GitHub Desktop.
Revisions
-
andyperlitch created this gist
Jan 25, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ import sublime, sublime_plugin class GoToRefCommand(sublime_plugin.TextCommand): def run(self, edit): pos = self.view.sel()[0].begin() region = self.view.extract_scope(pos) ref = self.view.substr(region).replace("'", "") folder = self.view.window().folders()[0] print("Going to ref: " + ref) # Check if there are any slashes if "/" in ref: self.view.window().open_file(folder + "/src/" + ref) else: print(ref)