Skip to content

Commit

Permalink
Respect go_fmt_options when running goimports
Browse files Browse the repository at this point in the history
  • Loading branch information
cespare committed Feb 19, 2017
1 parent 4490a1f commit ded4d31
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions autoload/go/fmt.vim
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,9 @@ function! s:fmt_cmd(bin_name, source, target)
" start constructing the command
let cmd = [bin_path]
call add(cmd, "-w")
call extend(cmd, split(g:go_fmt_options, " "))

if a:bin_name != "goimports"
call extend(cmd, split(g:go_fmt_options, " "))
else
if a:bin_name == "goimports"
" lazy check if goimports support `-srcdir`. We should eventually remove
" this in the future
if !exists('b:goimports_vendor_compatible')
Expand Down

0 comments on commit ded4d31

Please sign in to comment.