diff --git a/autoload/ale/fix.vim b/autoload/ale/fix.vim index 53c3fd2..4ff977b 100644 --- a/autoload/ale/fix.vim +++ b/autoload/ale/fix.vim @@ -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) diff --git a/test/test_ale_fix.vader b/test/test_ale_fix.vader index 49d0d2d..23c61f9 100644 --- a/test/test_ale_fix.vader +++ b/test/test_ale_fix.vader @@ -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