From 8798b24f5e4396752b879469cc698e033ebb8c17 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Wed, 19 May 2021 09:58:18 +0200 Subject: [PATCH] Fix auto-formatting on save breaking Parcel's watch mode --- autoload/elm.vim | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/autoload/elm.vim b/autoload/elm.vim index 5463466..321581b 100644 --- a/autoload/elm.vim +++ b/autoload/elm.vim @@ -67,12 +67,10 @@ function! elm#Format() abort if v:shell_error == 0 try | silent undojoin | catch | endtry - " replace current file with temp file, then reload buffer - let l:old_fileformat = &fileformat - call rename(l:tmpname, expand('%')) - silent edit! - let &fileformat = l:old_fileformat - let &syntax = &syntax + " replace current buffer with buffer from temp file + %delete + exe 'read ' . l:tmpname + 1delete elseif g:elm_format_fail_silently == 0 call elm#util#EchoLater('EchoError', 'elm-format:', l:out) endif