From 2c6b571e66ed88c769217935a781cc6cbf8b0349 Mon Sep 17 00:00:00 2001 From: w0rp Date: Sun, 25 Jun 2017 15:57:36 +0100 Subject: [PATCH] Fix #665 - Stop prompts appearing when fixing files on save --- autoload/ale/fix.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autoload/ale/fix.vim b/autoload/ale/fix.vim index 2e9cf2c..3e4c239 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)