summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/fix.vim8
1 files changed, 4 insertions, 4 deletions
diff --git a/autoload/ale/fix.vim b/autoload/ale/fix.vim
index 2e9cf2cc..3e4c2393 100644
--- a/autoload/ale/fix.vim
+++ b/autoload/ale/fix.vim
@@ -28,6 +28,10 @@ function! ale#fix#ApplyQueuedFixes() abort
call remove(g:ale_fix_buffer_data, l:buffer)
if l:data.changes_made
+ if l:data.should_save
+ noautocmd :w!
+ endif
+
call setline(1, l:data.output)
let l:start_line = len(l:data.output) + 1
@@ -76,10 +80,6 @@ function! ale#fix#ApplyFixes(buffer, output) abort
let l:data.done = 1
endif
- if l:data.changes_made && l:data.should_save
- call writefile(a:output, l:data.filename)
- endif
-
if !bufexists(a:buffer)
" Remove the buffer data when it doesn't exist.
call remove(g:ale_fix_buffer_data, a:buffer)