Lech Lorens wrote:

> In ":help format-comments" one can find the following fragment:
> 
> #v+
> Here is an example of alignment flags at work to make a comment stand out
> (kind of looks like a 1 too). Consider comment string >
>       sr:/***,m:**,ex2:******/
> 
>                                    /***
>                                      **<--right aligned from "r" flag
>                                      **
> offset 2 spaces from the "2" flag--->**
>                                    ******/
> In this case, the first comment was typed, then return was pressed 4 times,
> then "/" was pressed to end the comment.
> #v-
> 
> 
> Vim does not format comments as stated by this fragment. This is how 
> a similar fragment will be formatted by Vim:
> 
> #v+
> /* vim: set fo+=o com=sr\:/***,m\:**,ex2\:******/ :*/
> 
> aaa /***
>       **<--right aligned from "r" flag
>       **
>      ******/
> #v-
> 
> 
> What I noticed is that the additional indent specified for the end part 
> is ignored – no matter how large or small I set it, the fragment above 
> gets indented in the same way.
> 
> I'll be happy to fix both behaviours but the current documentation is 
> totally unclear to me with regard to the number specified for the end 
> comment and how the end comment is affected by the 'r' flag.
> 
> I expected that with the flags above the comment should be formatted as:
> 
> #v+
> /* vim: set fo+=o com=sr\:/***,m\:**,ex2\:******/ :*/
> 
> aaa /***
>       **<--right aligned from "r" flag
>       **
>         ******/<-- 2 specified for the end comment.
> #v-
> 
> 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.

-- 
hundred-and-one symptoms of being an internet addict:
76. Your ISP regards you as a business partner rather than as a customer.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

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