Wednesday, December 1, 2010

Re: folding refused, set filetype=c helps, why?

On Nov 30, 4:39 am, "fka...@googlemail.com" <fka...@googlemail.com>
wrote:
> Hi,
>
> I use syntax based folding in C code (vim 7.3.50). Sometimes when code
> is changed folding is refused completely, e.g. zc does not fold
> anymore. I found out that resetting the filetype helps (set
> filetype=c), although a previous check (set filetype? and set
> foldmethod?) shows that is was already c / syntax.
>
> So I wonder what 'set foldtype=c' internally does to reenable folding.
> Maybe this is a hint to solve this misbehaviour...
>

That does seem strange.

Internally, setting filetype=c will re-apply the syntax highlighting,
which will re-calculate all the folds.

You can try using zx, zX, or :syn sync fromstart to see if those have
any effect. The first two will have the additional effect of closing
any manually opened folds, the third will make syntax highlighting
slower.

Do existing folds stay as they were, and just a new fold refuses to
show up, or are all folds removed?

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: