Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FastFold breaks when used with sessions #57

Open
f4814 opened this issue Mar 27, 2019 · 3 comments
Open

FastFold breaks when used with sessions #57

f4814 opened this issue Mar 27, 2019 · 3 comments

Comments

@f4814
Copy link

f4814 commented Mar 27, 2019

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.

@Konfekt
Copy link
Owner

Konfekt commented Mar 27, 2019

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.

@f4814
Copy link
Author

f4814 commented Mar 28, 2019

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

@Konfekt
Copy link
Owner

Konfekt commented Mar 28, 2019

True, will update the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants