Add ALEFixPre and ALEFixPost events

To run autocmd before and after every fix cycle.

Fixes #623 (`ALELintPre` was added in #1203).
This commit is contained in:
Martin Tournoij
2017-12-23 13:13:55 +00:00
parent 92e6e4d1ba
commit 302f69e933
4 changed files with 28 additions and 5 deletions

View File

@@ -54,6 +54,8 @@ function! ale#fix#ApplyQueuedFixes() abort
let l:should_lint = l:data.changes_made
endif
silent doautocmd <nomodeline> User ALEFixPost
" If ALE linting is enabled, check for problems with the file again after
" fixing problems.
if g:ale_enabled
@@ -463,6 +465,8 @@ function! ale#fix#Fix(...) abort
call ale#fix#RemoveManagedFiles(l:buffer)
call ale#fix#InitBufferData(l:buffer, l:fixing_flag)
silent doautocmd <nomodeline> User ALEFixPre
call s:RunFixer({
\ 'buffer': l:buffer,
\ 'input': g:ale_fix_buffer_data[l:buffer].lines_before,