FastFold icon indicating copy to clipboard operation
FastFold copied to clipboard

FastFold breaks when used with sessions

Open f4814 opened this issue 6 years ago • 3 comments

Creating a session and then reloading it leaves foldmethod set to manual but FastFold is unable to update my folds manual folds already continuously updated.

From what I can see this is because w:lastfdm is not saved into the session.

I will look into it if I find the time.

f4814 avatar Mar 27 '19 17:03 f4814

By

" plugin/fastfold.vim (lines 101-116)
function! s:UpdateBuf(feedback)
  " skip if another session still loading
  if exists('g:SessionLoad') | return | endif

  let s:curbuf = bufnr('%')
  call s:WinDo("if bufnr('%') is s:curbuf | call s:LeaveWin() | endif")
  call s:WinDo("if bufnr('%') is s:curbuf | call s:EnterWin() | endif")

  if !a:feedback | return | endif

  if !exists('w:lastfdm')
    echomsg "'" . &l:foldmethod . "' folds already continuously updated"
  else
    echomsg "updated '" . w:lastfdm . "' folds"
  endif
endfunction

FastFold should not intervene if set sessionsoptions-=options is set. Note that even

https://github.com/tpope/vim-sensible/blob/master/plugin/sensible.vim

sets this. Please check if this resolves the issue; it will go into the documentation.

As a more through fix, try vim-stay.

Konfekt avatar Mar 27 '19 18:03 Konfekt

Thank you for the help. In my case it seems the problem was caused by set sessionoptions+=folds.

f4814 avatar Mar 28 '19 09:03 f4814

True, will update the documentation.

Konfekt avatar Mar 28 '19 12:03 Konfekt