From 6c1cc914c35735768e54fc4ab0be900a9d62797b Mon Sep 17 00:00:00 2001 From: Fatih Arslan Date: Mon, 18 Jan 2016 20:05:39 -0500 Subject: [PATCH] fmt: save folds on close --- autoload/go/fmt.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autoload/go/fmt.vim b/autoload/go/fmt.vim index 9ef9a2ebe2..c3e45f8707 100644 --- a/autoload/go/fmt.vim +++ b/autoload/go/fmt.vim @@ -54,8 +54,8 @@ let s:got_fmt_error = 0 " this and have VimL experience, please look at the function for " improvements, patches are welcome :) function! go#fmt#Format(withGoimport) - " save cursor position and many other things - let l:curw=winsaveview() + " save cursor position, folds and many other things + mkview! " Write current unsaved buffer to a temp file let l:tmpname = tempname() @@ -159,8 +159,8 @@ function! go#fmt#Format(withGoimport) call delete(tmpundofile) endif - " restore our cursor/windows positions - call winrestview(l:curw) + " restore our cursor/windows positions, folds, etc.. + silent! loadview endfunction