Monday, January 25, 2010

Re: Possible bug affecting append/insert commands within :global

Hi Brett!

On Mo, 25 Jan 2010, Brett Stahlman wrote:

>
>
> On Jan 25, 1:22 pm, Christian Brabandt <cbli...@256bit.org> wrote:
> > Hi Brett!
> >
> > On Mo, 25 Jan 2010, Brett Stahlman wrote:
> >
> > > Between my having responded several times to my own post, and this
> > > thread having been hijacked by someone attempting to unsuscribe, I'm
> > > thinking this thread might need a bump. Does anyone else get the
> > > errors above when running the example from the help?
> >
> > Yes, and it is even documented in the second paragraph following
> > :h :insert
>
> Christian,
> Are you referring to the following statement in the help on :insert?
>
> NOTE: ":append" and ":insert" don't work properly in between ":if" and
> ":endif", ":for" and ":endfor", ":while" and ":endwhile".

Similar. From
*insert.txt* For Vim version 7.2. Last change: 2009 Jul 14

[…]
*:i* *:in* *:insert*
:{range}i[nsert][!] Insert several lines of text above the specified
line. If the {range} is missing, the text will be
inserted before the current line.
Adding [!] toggles 'autoindent' for the time this
command is executed.

These two commands will keep on asking for lines, until you type a line
containing only a ".". Watch out for lines starting with a backslash, see
|line-continuation|.

NOTE: These commands cannot be used with |:global| or |:vglobal|.
":append" and ":insert" don't work properly in between ":if" and
":endif", ":for" and ":endfor", ":while" and ":endwhile".
[…]

> My understanding is that this caveat applies to :insert generally, not
> only to :insert within a :global command. Note, however, that I get
> errors for the :global usage even when it does not appear within one
> of those constructs. Were you saying that you do as well?

I think, You would need :set cpo+=C for this to work properly. But I
still couldn't get it to work. And the statement above confirms that.

regards,
Christian

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments: