> On 2012-01-15, AK wrote:
>
>> It does work for me but I'm dealing with lines that have
>> leading spaces and I add leading spaces, here is a relevant
>> snip:
>>
>> let l = getline(v:foldstart)
>> let line = substitute(l, '^[ ]*', '', '')
>> let prefix = repeat(' ', (strlen(l) - strlen(line)))
>> let c = ''
>> if l =~ '^\s*class\s' | let c = '(c)--' | endif
>> let line = prefix . '+--' . c . ' ' . line
>
> You can also use the indent() function to get the indentation of the
> line directly instead of calculating string lengths, e.g.,
>
> let n = v:foldend - v:foldstart + 1
> let i = indent(v:foldstart)
> return repeat(' ', i) . "+-" . v:folddashes . " " . n . " lines "
>
> Regards,
> Gary
>
Thanks! I know that now, but I wrote this function a
long time ago.. -ak
--
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
No comments:
Post a Comment