On Apr 23, 11:00 am, Tony Mechelynck <[EMAIL PROTECTED]>
wrote:
> On 23/04/08 17:40, fritzophrenic wrote:
>
>
>
>
>
> > On Apr 17, 1:12 pm, fritzophrenic<[EMAIL PROTECTED]>  wrote:
> >> See the vim_use 
> >> thread:http://groups.google.com/group/vim_use/browse_thread/thread/863a0ce08...
>
> >> It seems that a nested first line only comment will incorrectly
> >> prepend the comment leader on the next line if it occurs in the middle
> >> of a multiline comment or in a single-line comment.
>
> >> For example, in a new buffer:
>
> >> :set tw=20 comments=ns1:/*,nmb:*,nex:*/,nfb:NOTES: fo=tcqr cindent
>
> >> Type:
>
> >> /* NOTES: mary had a little lamb */
>
> >> The comments wrap exactly as expected, i.e.
>
> >> /* NOTES: mary had a
> >>   *        little
> >>   *        lamb */
>
> >> Now type:
>
> >> /*<CR>NOTES: Mary had a little lamb */
>
> >> This gives:
>
> >> /*
> >>   * NOTES: Mary had a
> >>   * NOTES: little
> >>   * NOTES: lamb */
>
> >> The same thing happens if you go into a pre-existing multiline comment
> >> and start typing. If the first-line-only comment is inserted on the
> >> first line of the multiline comment, it is fine. Otherwise, it fails.
>
> >> In addition:
>
> >> :set comments+=n://
>
> >> Type:
>
> >>   // NOTES: mary had a little lamb
>
> >> to get:
>
> >> // NOTES: Mary had a
> >> // NOTES: little
> >> // NOTES: lamb
>
> >> I'm using gvim 7.1.293, 'Big' compile on MS Windows (I got it off the
> >> 'cream' sourceforge page).
>
> > Any comments on this? I'm pretty sure it is a bug, but if it isn't,
> > I'd certainly like to know why!
>
>          /*
>           * This is a three-piece comment
>           * with start, middle and end:
>           * a single comment starts at
>           * slash-star and ends at star-slash
>           */
>
>           // This is a set of successive
>           // single-line comments:
>           // each double slash
>           // starts a new comment,
>           // which ends at the end of the line.
>
>           NOTE: This kind of comment
>                 can be nested within
>                  the above two kinds.
>                  But nesting does not
>                  overlap.
>
> By "overlapping", I mean like brackets or HTML tags: ([]) is valid but
> ([)] isn't.
>

So, I think I understand the behavior for single-line (//) comments
now.

// starts a comment
NOTES: starts a nested comment
end of line ends the outer comment, therefore ending the contained
comment started with NOTES:

But I'm still puzzled about the multi-line comment. From what I see:

/* starts the comment
*/ ends the comment
putting NOTES: anywhere between the two should allow it to continue as
normal until the end of the containing comment (*/) is encountered.

Do I misunderstand something? Also, why the inconsistent behavior
between NOTES: on the first line and NOTES: on in-between lines of the
multi-line comment?
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui