Allow b:ale_fixers to be used
This commit is contained in:
parent
ad52b9630d
commit
59d9f5d458
@ -235,10 +235,11 @@ function! s:RunFixer(options) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:GetCallbacks() abort
|
function! s:GetCallbacks() abort
|
||||||
|
let l:fixers = ale#Var(bufnr(''), 'fixers')
|
||||||
let l:callback_list = []
|
let l:callback_list = []
|
||||||
|
|
||||||
for l:sub_type in split(&filetype, '\.')
|
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('')
|
if type(l:sub_type_callacks) == type('')
|
||||||
call add(l:callback_list, l:sub_type_callacks)
|
call add(l:callback_list, l:sub_type_callacks)
|
||||||
|
@ -37,6 +37,7 @@ After:
|
|||||||
Restore
|
Restore
|
||||||
unlet! g:ale_run_synchronously
|
unlet! g:ale_run_synchronously
|
||||||
unlet! g:ale_emulate_job_failure
|
unlet! g:ale_emulate_job_failure
|
||||||
|
unlet! b:ale_fixers
|
||||||
delfunction AddCarets
|
delfunction AddCarets
|
||||||
delfunction AddDollars
|
delfunction AddDollars
|
||||||
delfunction DoNothing
|
delfunction DoNothing
|
||||||
@ -175,3 +176,12 @@ Expect(There should be an extra line):
|
|||||||
b
|
b
|
||||||
c
|
c
|
||||||
d
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user