Skip to content

Commit

Permalink
Properly use exepath for CheckBinPath
Browse files Browse the repository at this point in the history
fatih#823 added this the wrong way, it was reverted back on 9f0cf00 but still not achieving the right functionality.
This uses it properly now, also adding it to how we lookup goimports for srcdir support.
  • Loading branch information
luan committed May 20, 2016
1 parent d54819d commit 1a44e8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion autoload/go/fmt.vim
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ function! go#fmt#Format(withGoimport)

if fmt_command == "goimports"
if !exists('b:goimports_vendor_compatible')
let out = go#util#System("goimports --help")
let binpath = go#path#CheckBinPath("goimports")
echom binpath
let out = go#util#System(binpath . " --help")
if out !~ "-srcdir"
echohl WarningMsg
echomsg "vim-go: goimports does not support srcdir."
Expand Down
1 change: 1 addition & 0 deletions autoload/go/path.vim
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ function! go#path#CheckBinPath(binpath)

" if it's in PATH just return it
if executable(binpath)
let binpath = exepath(binpath)
let $PATH = old_path
return binpath
endif
Expand Down

0 comments on commit 1a44e8f

Please sign in to comment.