Is there a way to determine the foldlevel of the first closed fold on a
line? For example, with the following situation:

-- abc
|| def
|| ghi
|| jkl
|  mno
   pqr
   stu
   vwx
   yz

If I close all folds, I want to be able to get '1' for the fold level of the
first line. If I open that first fold, I want to be able to get '2'.

:help foldlevel() says that it will always return the deepest fold (i.e. 2)
regardless of whether folds are open or closed.

The best I can think of is to save off the value of the foldtext option, set
the foldtext option to the default, use foldtextresult() to get the classic
fold text, count the number of dashes in the fold text, and then restore the
foldtext option. There has to be a better way, doesn't there?

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to