Konfekt / FastFold

Speed up Vim by updating folds only when called-for.
708 stars 24 forks source link

folds deleted in split window with folddexpr=pandoc#folding#FoldExpr() #53

Open Konfekt opened 6 years ago

Konfekt commented 6 years ago

Withhttps://github.com/vim-pandoc/vim-pandoc and foldmethod = expr and foldexpr=pandoc#folding#FoldExpr(), then on opening a pandoc file, for example, a file with extension md, and splitting the window in which the buffer is displayed, for example by :split, then all folds disappear and cannot be restored.

This does not happen, for example, for foldexpr=MarkdownFold().

hgvhgv commented 3 years ago

Any update on this or workaround? FastFold has otherwise been a godsend!

Konfekt commented 3 years ago

This is working fine for me on Vim 8.1568 using the latest version of vim-pandoc.

hgvhgv commented 3 years ago

Hmm, I was having a problem that seemed like this (folds deleted when I split the buffer) but can't recreate with a new file. Must be something about that file itself. Thanks! I'll file a different bug if I can reproduce (up to you whether to close).

hgvhgv commented 3 years ago

Playing around some more I was able to recreate the problem with a new file after I split the buffer and run :e, deleting the folds (which then come back when I remove the split). But I can't reproduce with a minimal vimrc, so it's some other plugin that is causing the problem (probably an autocommand). Again, if I figure it out I'll file another bug.

hgvhgv commented 3 years ago

I figured out that my problems are coming from a conflict between vim-pandoc and vim's filetype.vim, with b:undo_ftplugin being executed when I run :edit (see https://github.com/vim-pandoc/vim-pandoc/issues/237). This unsets a number of things that then affect the folds in turn but doesn't have to do with fastfold itself (I think).