mirror of
https://github.com/dense-analysis/ale.git
synced 2026-03-05 14:44:24 +08:00
#591 Support fixing files on save
This commit is contained in:
14
autoload/ale/events.vim
Normal file
14
autoload/ale/events.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
" Author: w0rp <devw0rp@gmail.com>
|
||||
|
||||
function! ale#events#SaveEvent() abort
|
||||
let l:should_lint = g:ale_enabled && g:ale_lint_on_save
|
||||
|
||||
if g:ale_fix_on_save
|
||||
let l:will_fix = ale#fix#Fix('save_file')
|
||||
let l:should_lint = l:should_lint && !l:will_fix
|
||||
endif
|
||||
|
||||
if l:should_lint
|
||||
call ale#Queue(0, 'lint_file')
|
||||
endif
|
||||
endfunction
|
||||
Reference in New Issue
Block a user