开发者

When does VIM reevaluate foldexpr?

开发者 https://www.devze.com 2023-03-26 09:32 出处:网络
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 whe

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

0

精彩评论

暂无评论...
验证码 换一张
取 消