Allow b:ale_fixers to be used

This commit is contained in:
w0rp 2017-05-20 16:00:05 +01:00
parent ad52b9630d
commit 59d9f5d458
2 changed files with 12 additions and 1 deletions

View File

@ -235,10 +235,11 @@ function! s:RunFixer(options) abort
endfunction
function! s:GetCallbacks() abort
let l:fixers = ale#Var(bufnr(''), 'fixers')
let l:callback_list = []
for l:sub_type in split(&filetype, '\.')
let l:sub_type_callacks = get(g:ale_fixers, l:sub_type, [])
let l:sub_type_callacks = get(l:fixers, l:sub_type, [])
if type(l:sub_type_callacks) == type('')
call add(l:callback_list, l:sub_type_callacks)

View File

@ -37,6 +37,7 @@ After:
Restore
unlet! g:ale_run_synchronously
unlet! g:ale_emulate_job_failure
unlet! b:ale_fixers
delfunction AddCarets
delfunction AddDollars
delfunction DoNothing
@ -175,3 +176,12 @@ Expect(There should be an extra line):
b
c
d
Execute(ALEFix should user buffer-local fixer settings):
let g:ale_fixers.testft = ['AddCarets', 'AddDollars']
let b:ale_fixers = {'testft': ['RemoveLastLine']}
ALEFix
Expect(There should be only two lines):
a
b