Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions autoload/elm.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down