Skip to content

Bad fold interaction with sessions #31

@ches

Description

@ches

Hi, thanks for the plugin!

I use vim-session, and unfortunately Braceless's folding seems to result in some undesirable interaction with it. vim-session persists manual folds in its session files, so I'm guessing that's the crux of the problem. Actually, standard :mksession does too, so similar problems might crop up with usage of the native session support.

Basically, the annoying behavior is this:

  1. Open a session for the first time with BracelessEnable +fold in effect.
  2. Invoke closing a fold (I think this is necessary once, to trigger computation of the manual folds).
  3. Save and close the session, with no folds closed in the file.
  4. Open it again. All the folds are closed. Or at least most of them, maybe the scope of the one block that had been folded, I can't quite tell exactly.

So now I have to manually zR everything every time I re-open a session. I have set foldlevelstart=99 as a default in my config, but I'm assuming that Braceless's fold approach doesn't or can't support that. Or maybe the manual folds saved in the session subvert it upon restore.

If I disable Braceless, re-open the session, zE on the buffers, save session and re-open it, all is well again. Until Braceless is enabled again… I could try to bufdo zE when closing sessions with an autocommand or something, but Braceless won't allow that.

Any ideas about how this situation could be improved?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions