Monday, June 21, 2010

Re: Automatic lists

On Jun 20, 6:36 pm, Tony Mechelynck <antoine.mechely...@gmail.com>
wrote:
> On 20/06/10 23:10, Jay Heyl wrote:
>
> > I use Vim primarily for editing C source files. The feature that
> > automatically repeats the comment marker, "//", at the start of a new
> > line in insert mode is great.
>
> > Unfortunately, what I suspect is a related characteristic is not so
> > great. Several times now I've been editing a line that begins with a
> > multiply symbol, "*", separated by a space from the variable name that
> > follows. When I press Enter I get a multiply symbol at the start of the
> > next line. This isn't a major annoyance when I'm entering new code
> > because it's readily noticeable, but when I'm reformatting existing code
> > it's very easy to overlook and can create some highly unwanted results.
> > Recently this happened and I didn't catch it. The result was an infinite
> > loop that cost about two man-days to find.
>
>
> I think Vim mistakes your multiply operator for the middle part of a
> three-piece comment

I think this as well. You can fix this (but lose the automatic
insertion of these three-piece comments) by tweaking your 'comments'
option, probably in ~/.vim/after/ftplugin/c.vim, to remove the "s1:/
*,mb:*,ex:*/" that is included by default.

See :help 'comments' and :help format-comments for details.

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