From 0d48ba92455548018105670980552e54930f60eb Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Fri, 9 Oct 2020 22:57:13 +0200 Subject: Fix detecting of some filetypes, closes #579 --- autoload/go/config.vim | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'autoload/go') diff --git a/autoload/go/config.vim b/autoload/go/config.vim index 355f90fb..b450ad16 100644 --- a/autoload/go/config.vim +++ b/autoload/go/config.vim @@ -266,15 +266,25 @@ function! go#config#SetTemplateAutocreate(value) abort endfunction function! go#config#MetalinterCommand() abort - return get(g:, "go_metalinter_command", "golangci-lint") + return get(g:, 'go_metalinter_command', 'golangci-lint') endfunction function! go#config#MetalinterAutosaveEnabled() abort - return get(g:, "go_metalinter_autosave_enabled", ["govet", "golint"]) + let l:default = [] + if get(g:, 'go_metalinter_command', 'golangci-lint') == 'golangci-lint' + let l:default = ['govet', 'golint'] + endif + + return get(g:, 'go_metalinter_autosave_enabled', l:default) endfunction function! go#config#MetalinterEnabled() abort - return get(g:, "go_metalinter_enabled", ["vet", "golint", "errcheck"]) + let l:default = [] + if get(g:, 'go_metalinter_command', 'golangci-lint') == 'golangci-lint' + let l:default = ['vet', 'golint', 'errcheck'] + endif + + return get(g:, 'go_metalinter_enabled', l:default) endfunction function! go#config#GolintBin() abort -- cgit v1.2.3