mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-06 03:23:29 +08:00
Tell users when a fixer does not exist, and make the no fixers message softer
This commit is contained in:
@@ -352,11 +352,21 @@ function! ale#fix#Fix(...) abort
|
||||
throw "fixing_flag must be either '' or 'save_file'"
|
||||
endif
|
||||
|
||||
let l:callback_list = s:GetCallbacks()
|
||||
try
|
||||
let l:callback_list = s:GetCallbacks()
|
||||
catch /E700/
|
||||
let l:function_name = join(split(split(v:exception, ':')[3]))
|
||||
echom printf(
|
||||
\ 'There is no fixer named `%s`. Check :ALEFixSuggest',
|
||||
\ l:function_name,
|
||||
\)
|
||||
|
||||
return 0
|
||||
endtry
|
||||
|
||||
if empty(l:callback_list)
|
||||
if l:fixing_flag is# ''
|
||||
echoerr 'No fixers have been defined. Try :ALEFixSuggest'
|
||||
echom 'No fixers have been defined. Try :ALEFixSuggest'
|
||||
endif
|
||||
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user