Hi,

I have this simple GuivhoFoldText function:

    function! GuivhoFoldText() " show text b4 marker and count
        return getline(v:foldstart) . ' ⋯' . (v:foldend - v:foldstart
+ 1) . '⋯ '
    endfunction

As apparent from the code, I want the complete text before the marker to
be shown, followed by the number of folded lines.

The important issue is that the displayed text should keep the original
indentation whitespace so that its folded text would start on the column
where it starts in the unfolded state.

This works well if the file formatting matches the current smarttab,
smartindent, softtabstop etc settings.

For a file that has leading tabs although it is supposed not to use tabs
but spaces, this foldtext expression fails. It returns one single space
for each leading tab, rather than either the leading whitespace
verbatim or the leading text where the leading tabs are replaced by
 &softtabstop spaces (4 in casu).

As soon as I issue ':retab' the foldtext expression works as desired.
But I do not own this file, so it would be unpolite to the owner to
return his/her file with whitespace changes all over...

Anybody has any suggestion how my foldtext function can be ameliorated
so that it also works without performing a :retab?

Thanks in advance,


Guido

--
So many men, so many opinions; every one his own way.
                -- Publius Terentius Afer (Terence)

http://vanhoecke.org ... and go2 places!

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

Reply via email to