#1108 Support setting b:ale_linter_aliases to a List

This commit is contained in:
w0rp
2017-11-12 00:11:50 +00:00
parent b98387d0fa
commit d20e3bc71c
3 changed files with 29 additions and 1 deletions

View File

@@ -261,12 +261,19 @@ function! ale#linter#GetAll(filetypes) abort
endfunction
function! s:GetAliasedFiletype(original_filetype) abort
let l:buffer_aliases = get(b:, 'ale_linter_aliases', {})
" b:ale_linter_aliases can be set to a List.
if type(l:buffer_aliases) is type([])
return l:buffer_aliases
endif
" Check for aliased filetypes first in a buffer variable,
" then the global variable,
" then in the default mapping,
" otherwise use the original filetype.
for l:dict in [
\ get(b:, 'ale_linter_aliases', {}),
\ l:buffer_aliases,
\ g:ale_linter_aliases,
\ s:default_ale_linter_aliases,
\]