Skip to content

Commit

Permalink
attempt at fixing bug #30
Browse files Browse the repository at this point in the history
  • Loading branch information
farmergreg committed Aug 23, 2023
1 parent eab4cb2 commit a2b678d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugin/vim-lastplace.vim
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if !exists('g:lastplace_ignore_buftype')
let g:lastplace_ignore_buftype = "quickfix,nofile,help"
endif

fu! s:lastplace()
fu! s:lastplace_jump()
if index(split(g:lastplace_ignore_buftype, ","), &buftype) != -1
return
endif
Expand Down Expand Up @@ -62,6 +62,9 @@ fu! s:lastplace()
execute "keepjumps normal! \G'\"\<c-e>"
endif
endif
endf

fu! s:lastplace_open_folds()
if foldclosed(".") != -1 && g:lastplace_open_folds
"if we're in a fold, make the current line visible and recenter screen
execute "normal! zvzz"
Expand All @@ -70,5 +73,6 @@ endf

augroup lastplace_plugin
autocmd!
autocmd BufRead * call s:lastplace()
autocmd BufRead * call s:lastplace_jump()
autocmd BufWinEnter * call s:lastplace_open_folds()
augroup END

0 comments on commit a2b678d

Please sign in to comment.