Robert Webb wrote:

> I noticed a change in behaviour when moving from 7.3 to 8.1, when opening a
> line after or before a "// blah" style comment.
> 
> With the cursor on the comment line, it used to be that opening a line
> above (with "O") would not insert a comment leader at the start, and same
> with opening a line below (with "o").
> 
> Now it does insert a comment leader in both cases.
> 
> This is never what I want.  If I want to extend a comment I hit "A" to
> append and hit Enter to start the new line.  This inserts the comment
> leader.  I feel like I'm "in" the comment in this case, as opposed to
> opening a line "after" the comment.

The basic idea of the current behavior is that when the cursor is in
the comment then opening a new line adds to the comment.  If you want to
add code, use "o" on the line above the comment or "O" on the line below
the comment.  Or just have the command leader added and use CTRL-W to
remove it.

> By default, in a C++ file, I have:
> 
> :set comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
> 
> I tried adding a "O" before "://".  This prevents the comment leader being
> inserted when opening a line above the comment, but NOT when opening a line
> below.
> 
> Is that a bug?  There appears no way to stop the behaviour when opening a
> line below the comment.
> 
> I believe opening a line above or below a //-style comment shouldn't insert
> the comment leader by default.  When I do this, my intention is almost
> always to insert code after the comment.  I can easily continue the comment
> instead by appending to it instead.

Different users, different habits.

> Also, how would I easily change "://" to "O://" in my vimrc, without
> re-entering the rest of the setting?  I guess I want to substitute part of
> the value.

set comments-=:// comments+=O://

-- 
Microsoft is to software what McDonalds is to gourmet cooking

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui