#1108 Support using Lists and 'all' for b:ale_linters

This commit is contained in:
w0rp 2017-11-11 23:55:04 +00:00
parent 3111c6c1ca
commit ae08f80ead
3 changed files with 52 additions and 6 deletions

View file

@ -289,11 +289,19 @@ function! ale#linter#ResolveFiletype(original_filetype) abort
endfunction
function! s:GetLinterNames(original_filetype) abort
for l:dict in [
\ get(b:, 'ale_linters', {}),
\ g:ale_linters,
\ s:default_ale_linters,
\]
let l:buffer_ale_linters = get(b:, 'ale_linters', {})
" b:ale_linters can be set to 'all'
if l:buffer_ale_linters is# 'all'
return 'all'
endif
" b:ale_linters can be set to a List.
if type(l:buffer_ale_linters) is type([])
return l:buffer_ale_linters
endif
for l:dict in [l:buffer_ale_linters, g:ale_linters, s:default_ale_linters]
if has_key(l:dict, a:original_filetype)
return l:dict[a:original_filetype]
endif