On Sun, Oct 08, 2006 at 05:49:38PM +0200, Eric Smith wrote:
> Is it possible for foldtext to show the number of the fold block.
> For example there are n paragraphs in a document and folding is by
> expression
> defined as a blank line.
> I want the number of the paragraph to show in the foldtext.
This is just proof of concept:
set foldtext=MyFoldText()
function MyFoldText()
let parcnt = 0
execute v:foldstart . "," . v:foldend . "g/^$/let parcnt += 1"
return parcnt . " paragraphs"
endfunction
You might want to return something like
substitute(foldtext, ":", ", " . parcnt . " paragraphs:", "")
(untested).
HTH --Benji Fisher