Write and read from the viminfo before and after formatting.

This should preserve the marks. Fixes #96.
This commit is contained in:
Chiel ten Brinke 2018-10-10 18:57:12 +02:00
parent b8173cde86
commit f749df790c

View File

@ -297,7 +297,7 @@ endfunction
" Create a command for formatting the entire buffer
" Save and recall window state to prevent vim from jumping to line 1
command! -nargs=? -range=% -complete=filetype -bar Autoformat let winview=winsaveview()|<line1>,<line2>call s:TryAllFormatters(<f-args>)|call winrestview(winview)
command! -nargs=? -range=% -complete=filetype -bar Autoformat let winview=winsaveview()|wviminfo|<line1>,<line2>call s:TryAllFormatters(<f-args>)|call winrestview(winview)|rviminfo
" Functions for iterating through list of available formatters