summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-11-11 23:55:04 +0000
committerw0rp <devw0rp@gmail.com>2017-11-11 23:55:11 +0000
commitae08f80eade5c28efa54d8366368f2addaec6f35 (patch)
tree2502a837c59babf2acd77b58db5a2be326b25b7d /autoload
parent3111c6c1ca22e759ea0a8dd4ac9f5d048cbcef24 (diff)
downloadale-ae08f80eade5c28efa54d8366368f2addaec6f35.zip
#1108 Support using Lists and 'all' for b:ale_linters
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/linter.vim18
1 files changed, 13 insertions, 5 deletions
diff --git a/autoload/ale/linter.vim b/autoload/ale/linter.vim
index 269b0929..00ab916a 100644
--- a/autoload/ale/linter.vim
+++ b/autoload/ale/linter.vim
@@ -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