summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--autoload/ale/fix.vim20
-rw-r--r--test/test_ale_fix.vader5
2 files changed, 5 insertions, 20 deletions
diff --git a/autoload/ale/fix.vim b/autoload/ale/fix.vim
index 89778a16..b2ca2575 100644
--- a/autoload/ale/fix.vim
+++ b/autoload/ale/fix.vim
@@ -241,29 +241,19 @@ function! s:GetCallbacks() abort
return []
endif
- let l:problem_list = []
let l:corrected_list = []
for l:item in l:callback_list
if type(l:item) == type('')
- if exists('*' . l:item)
- call add(l:corrected_list, function(l:item))
- else
- let l:func = ale#fix#registry#GetFunc(l:item)
+ let l:func = ale#fix#registry#GetFunc(l:item)
- if !empty(l:func) && exists('*' . l:func)
- call add(l:corrected_list, function(l:func))
- else
- call add(l:problem_list, l:item)
- endif
+ if !empty(l:func)
+ let l:item = l:func
endif
endif
- endfor
- if !empty(l:problem_list)
- echoerr 'Invalid fixers used: ' . string(l:problem_list)
- return []
- endif
+ call add(l:corrected_list, function(l:item))
+ endfor
return l:corrected_list
endfunction
diff --git a/test/test_ale_fix.vader b/test/test_ale_fix.vader
index a872f38e..8e61aefe 100644
--- a/test/test_ale_fix.vader
+++ b/test/test_ale_fix.vader
@@ -128,11 +128,6 @@ Expect(The first function should be used):
^b
^c
-Execute(ALEFix should complain for missing functions):
- let g:ale_fixers.testft = ['XXX', 'YYY']
- AssertThrows ALEFix
- AssertEqual 'Vim(echoerr):Invalid fixers used: [''XXX'', ''YYY'']', g:vader_exception
-
Execute(ALEFix should use functions from the registry):
call ale#fix#registry#Add('add_carets', 'AddCarets', [], 'Add some carets')
let g:ale_fixers.testft = ['add_carets']