You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Open a session for the first time with BracelessEnable +fold in effect.
Invoke closing a fold (I think this is necessary once, to trigger computation of the manual folds).
Save and close the session, with no folds closed in the file.
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?
The text was updated successfully, but these errors were encountered:
I think the issue I'm seeing is how the session is generating the fold commands, which seems to be caused by overlapping folds created by this plugin. The best way to deal with this is probably to only create shallow folds for the current cursor instead of trying to preemptively create all the folds for a block. In addition, destroy the fold if it's opened. That way the generated session script could only mess with the folds it sees.
I'm not a big fan of how folding is handled by Vim in general. In particular, the fact that there isn't a "ignore foldlevel and foldstartlevel entirely" option.
The way I'm dealing with it is forcing all buffers to start with all folds open:
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:
BracelessEnable +fold
in effect.So now I have to manually
zR
everything every time I re-open a session. I haveset 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 tobufdo zE
when closing sessions with an autocommand or something, but Braceless won't allow that.Any ideas about how this situation could be improved?
The text was updated successfully, but these errors were encountered: