On 10-May-2011 Bram Moolenaar <[email protected]> wrote:
> > And only an offset of -2 should produce what the documentation mentions:
> > 
> > #v+
> > /* vim: set fo+=o com=sr\:/***,m\:**,ex-2\:******/ :*/
> > 
> > aaa /***
> >       **<--right aligned from "r" flag
> >       **
> >     ******/<-- -2 specified for the end comment.
> > #v-
> > 
> > Is there anyone who knows what should in fact happen?
> > Bram?
> 
> The docs clearly say:
> 
>   {digits}
>       When together with 's' or 'e': add {digit} amount of offset to an
>       automatically inserted middle or end comment leader. The offset begins
>       from a left alignment. See below for more details.
> 
>   -{digits}
>       Like {digits} but reduce the indent.  This only works when there is
>       some indent for the start or end part that can be removed.
> 
> 
> Thus the example should use "-2" to get the desired output.
> 
> Would be great if you can fix that.

I've looked at the code. It seems that this feature was never 
implemented (i.e. the offset among the options for the closing comment 
is simply ignored).

I modified insertchar() in edit.c so that the closing part is correctly 
indented (with the offset) when the auto-close comment functionality is 
triggered but:
• my solution uses spaces – it does not take into account the value of 
  'et', 'ts', etc.,
• get_c_indent() does not handle the offset setting.

It could be done but is it worth it? I'd say that the feature seems so 
obscure that perhaps it would be better to adjust the documentation?

-- 
Cheers,
Lech

-- 
You received this message from the "vim_dev" 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

Raspunde prin e-mail lui