Friday, January 9, 2015

Re: Can I mix the use of fold-expr with fold-marker just as mixing fold-expr with fold-manual?

On Thursday, January 8, 2015 at 8:04:18 PM UTC-6, Bao Niu wrote:
>
> Thanks Ben, I will conform to the convention and won't top-post in future.
> By 'storing' I actually did not refer to persisting, but temporary. When I use foldmethod=expr to automatically fold up my classes, the foldlevel must be 'stored' somewhere, or otherwise after I switch to manual it would have been all lost. Is there something I'm wrong about this model? Then where does Vim temporarily store such thing? Enviroment variables? Or something?

The idea with using a fold expression is that you won't NEED to switch to manual mode. All your folds would be defined automatically by the function you write.

When you switch fold method, Vim knows in its own internal window state where folds are, and it just keeps them around to initialize the manual folding. There is no associated buffer or user-accessible variable containing all the folds, but you can figure them out using the foldlevel(), foldclosed(), foldclosedend() functions.

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: