Saturday, December 28, 2013

Re: display the title of current fold in the statusline


On Dec 28, 2013 6:57 PM, "BimbaLaszlo" <bimba.laszlo@gmail.com> wrote:
>
> How can i use it? I like to know in which fold the cursor is, which fold is "under editing", but the help says it returns the title of closed folds:

I do not know how to operate on open folds. In fact the only my plugin that needed this just closed all folds before proceeding. You may try to replicate vim functionality using eval(), substitute() and &foldtext and &foldexpr/getline()/syn*(), but this will work only for a limited number of setups.

If you want to temporary close folds, get fold text and reopen them  then foldclosed(), :foldclose, :foldopen and winsaveview()+winrestview() are your friends.

> foldtextresult({lnum})                                  *foldtextresult()*
>                 Returns the text that is displayed for the closed fold at line
>                 {lnum}.  Evaluates 'foldtext' in the appropriate context.
>                 When there is no closed fold at {lnum} an empty string is
>                 returned.
>
> --
> --
> 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/groups/opt_out.

--
--
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/groups/opt_out.

No comments:

Post a Comment