diff options
author | w0rp <devw0rp@gmail.com> | 2017-05-19 15:24:21 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-05-20 19:02:36 +0100 |
commit | 74691269ce7050e6c13053bd884af9c05b630c1e (patch) | |
tree | fba6079908b7c3dc72a870daba27fb0ce8b7dde5 | |
parent | 18467a55b527358613589ed087c5a308fb37b898 (diff) | |
download | ale-74691269ce7050e6c13053bd884af9c05b630c1e.zip |
Run a lint cycle after fixing problems
-rw-r--r-- | autoload/ale/fix.vim | 6 | ||||
-rw-r--r-- | test/test_ale_fix.vader | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/autoload/ale/fix.vim b/autoload/ale/fix.vim index 9fe99563..abb6afe9 100644 --- a/autoload/ale/fix.vim +++ b/autoload/ale/fix.vim @@ -41,6 +41,12 @@ function! ale#fix#ApplyQueuedFixes() abort silent execute l:start_line . ',' . l:end_line . 'd' call winrestview(l:save) endif + + " If ALE linting is enabled, check for problems with the file again after + " fixing problems. + if g:ale_enabled + call ale#Queue(g:ale_lint_delay) + endif endfunction function! s:ApplyFixes(buffer, output) abort diff --git a/test/test_ale_fix.vader b/test/test_ale_fix.vader index 71fd84fe..04657e9e 100644 --- a/test/test_ale_fix.vader +++ b/test/test_ale_fix.vader @@ -1,5 +1,6 @@ Before: - Save g:ale_fixers, &shell + Save g:ale_fixers, &shell, g:ale_enabled + let g:ale_enabled = 0 let g:ale_run_synchronously = 1 let g:ale_fixers = { \ 'testft': [], @@ -31,6 +32,7 @@ Before: function RemoveLastLine(buffer, lines) abort return ['a', 'b'] endfunction + After: Restore unlet! g:ale_run_synchronously |