Skip to content

Commit

Permalink
Merge pull request #735 from mhamrle/master
Browse files Browse the repository at this point in the history
add support for goimports -srcdir in Format
  • Loading branch information
fatih committed Feb 24, 2016
2 parents a60a932 + 99d250b commit 199fa8f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions autoload/go/fmt.vim
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,17 @@ function! go#fmt#Format(withGoimport)
if a:withGoimport != 1
let command = command . g:go_fmt_options
endif
if fmt_command == "goimports"
let out = system("goimports --help")
if out !~ "-srcdir"
echohl WarningMsg
echomsg "vim-go: goimports does not support srcdir."
echomsg " update with: :GoUpdateBinaries"
echohl None
else
let command = command . '-srcdir ' . fnameescape(expand("%:p:h"))
endif
endif

" execute our command...
let out = system(command . " " . l:tmpname)
Expand Down

0 comments on commit 199fa8f

Please sign in to comment.