Created
June 18, 2018 07:19
-
-
Save zmack/9b154fc581a00ff231ded48e8549b509 to your computer and use it in GitHub Desktop.
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 characters
function RacerGoToDefinition() | |
let current_line = line(".") | |
let current_column = col(".") | |
let current_file = expand("%") | |
let command = g:racer_cmd." find-definition ".current_line." ".current_column." ".current_file | |
let definition = system(command) | |
let matches = split(split(definition, "\n")[0], ",") | |
if split(matches[0], " ")[0] != "MATCH" | |
return | |
endif | |
let file = matches[3] | |
let column = matches[2] | |
let line = matches[1] | |
execute ":e ".file | |
execute ":call cursor(".line.", ".column.")" | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment