Skip to content

Commit

Permalink
Merge pull request #691 from fatih/fix-fold
Browse files Browse the repository at this point in the history
fmt: save folds on close
  • Loading branch information
fatih committed Feb 16, 2016
2 parents 8f3d83f + 6c1cc91 commit ff56a31
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions autoload/go/fmt.vim
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ endif
" 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()
Expand Down Expand Up @@ -158,8 +158,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


Expand Down

0 comments on commit ff56a31

Please sign in to comment.