Skip to content

Commit

Permalink
fmt: save folds on close
Browse files Browse the repository at this point in the history
  • Loading branch information
fatih committed Jan 19, 2016
1 parent 55467c6 commit 6c1cc91
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 @@ -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()
Expand Down Expand Up @@ -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


Expand Down

0 comments on commit 6c1cc91

Please sign in to comment.