On 2006-10-30, Kim Schulz <[EMAIL PROTECTED]> wrote:
> Hi
> Is there a way to have tab chars in foldtext? 
> I have tried with 
> 
> set foldtext=getline(v:foldstart).'^I^I'.v:foldstart
> but with no luck. Have also tried with \t and <Tab>
> 
> so is this possible and how? 

It's not possible.  At least it wasn't the last time I looked at the 
source code (f_foldtext() in eval.c).  The routine that calls the 
'foldtext' function replaces each tab in the returned string by a 
space.  Here's what I did at the time to get the indentation I 
wanted.  Using the repeat() function would simplify this, but it 
wasn't available at the time.

    function! MyFoldText()
        let n = v:foldend - v:foldstart + 1
        let i = indent(v:foldstart)
        let istr = ''
        while i > 0
            let istr = istr . ' '
            let i = i - 1
        endwhile
        return istr . "+-" . v:folddashes . " " . n . " lines "
    endfunction

HTH,
Gary

-- 
Gary Johnson                 | Agilent Technologies
[EMAIL PROTECTED]     | Wireless Division
                             | Spokane, Washington, USA

Reply via email to