I am trying to figure out when VIM's foldexpr
is reevaluated.
In my case, I have set foldexpr=MySpecialFunction(v:lnum)
and it seems to me that MySpecialFunction
is only called when the buffer is opened or when I delete a line that closes a fold.
Intuitively, I would have assumed that I can trigger a reevaluation with ctrl-l
yet it doesn't.
For what it is worth: my VIM's version is 7.3
I think, there is no way documented to force reevaluating the foldexpr. I have asked the same some time ago at the vim mailinglist. In the end, a patch was made, that made zx and zX reevaluate the foldexpression, which was good enough for me.
I only noticed two ways to force to reevaluate the foldexpression: to have a noop filter (e.g. filter through cat) or reset the foldexpression.
See the discussion in the vim mailinglist: http://groups.google.com/group/vim_dev/msg/6f13fa0dfcb06317
精彩评论