From ded4d3169f28ffa774af97bc3582df95027c7135 Mon Sep 17 00:00:00 2001 From: Caleb Spare Date: Sun, 19 Feb 2017 12:48:25 -0800 Subject: [PATCH] Respect go_fmt_options when running goimports --- autoload/go/fmt.vim | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/autoload/go/fmt.vim b/autoload/go/fmt.vim index f6a92ea811..4429942daa 100644 --- a/autoload/go/fmt.vim +++ b/autoload/go/fmt.vim @@ -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')