Skip to content

Commit

Permalink
Merge pull request #2150 from ldelossa/godef-in-path
Browse files Browse the repository at this point in the history
Run godef from buffer path
  • Loading branch information
bhcleek authored Feb 22, 2019
2 parents c860f7c + b83f4c2 commit bf951d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions autoload/go/def.vim
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ function! go#def#Jump(mode) abort
if &modified
let l:stdin_content = join(go#util#GetLines(), "\n")
call add(l:cmd, "-i")
let [l:out, l:err] = go#util#Exec(l:cmd, l:stdin_content)
let [l:out, l:err] = go#tool#ExecuteInDir(l:cmd, l:stdin_content)
else
let [l:out, l:err] = go#util#Exec(l:cmd)
let [l:out, l:err] = go#util#ExecuteInDir(l:cmd)
endif
elseif bin_name == 'guru'
let cmd = [go#path#CheckBinPath(bin_name)]
Expand Down
4 changes: 2 additions & 2 deletions autoload/go/tool.vim
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function! go#tool#FilterValids(items) abort
return filtered
endfunction

function! go#tool#ExecuteInDir(cmd) abort
function! go#tool#ExecuteInDir(cmd, ...) abort
if !isdirectory(expand("%:p:h"))
return ['', 1]
endif
Expand All @@ -175,7 +175,7 @@ function! go#tool#ExecuteInDir(cmd) abort
let dir = getcwd()
try
execute cd . fnameescape(expand("%:p:h"))
let [l:out, l:err] = go#util#Exec(a:cmd)
let [l:out, l:err] = call('go#util#Exec', [a:cmd] + a:000)
finally
execute cd . fnameescape(l:dir)
endtry
Expand Down

0 comments on commit bf951d9

Please sign in to comment.