Lech Lorens wrote:

> The attached patch adds the "j" flag to 'formatoptions' which is
> described in todo.txt as follows:
> 7   Add 'j' flag to 'formatoptions': Remove comment leader when joining lines.
> 
> It makes it possible to perform a join on the following lines:
> #v+
> /*
>  * Comment
>  */
> #v-
> 
> to obtain:
> #v+
> /* Comment */
> #v-
> 
> It detects comments after some code, so:
> #v+
> if (condition) /* Comment
>                 * comment.
>               */
> #v-
> 
> will become:
> #v+
> if (condition) /* Comment comment */
> #v-
> 
> and is intelligent enough to convert:
> #v+
> if (condition) // comment
>                // comment
> {
> #v-
> 
> into:
> #v+
> if (condition) // comment comment
> {
> #v-
> 
> but to keep the comment leader in the following situation:
> #v+
> if (condition) /* comment */
>                // comment
> {
> #v-
> 
> and yield:
> #v+
> if (condition) /* comment */ // comment
> {
> #v-
> 
> I added some tests for the functionality.

Thanks!  I'll check it out later.

-- 
You have heard the saying that if you put a thousand monkeys in a room with a
thousand typewriters and waited long enough, eventually you would have a room
full of dead monkeys.
                                (Scott Adams - The Dilbert principle)

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