From f749df790cdec702654f6ad6d683ff239aa228df Mon Sep 17 00:00:00 2001 From: Chiel ten Brinke Date: Wed, 10 Oct 2018 18:57:12 +0200 Subject: [PATCH] Write and read from the viminfo before and after formatting. This should preserve the marks. Fixes #96. --- plugin/autoformat.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/autoformat.vim b/plugin/autoformat.vim index adacb78..142713c 100644 --- a/plugin/autoformat.vim +++ b/plugin/autoformat.vim @@ -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()|,call s:TryAllFormatters()|call winrestview(winview) +command! -nargs=? -range=% -complete=filetype -bar Autoformat let winview=winsaveview()|wviminfo|,call s:TryAllFormatters()|call winrestview(winview)|rviminfo " Functions for iterating through list of available formatters