Ramel Eshed wrote:
> > > > > vim -u NONE
> > > > >
> > > > > ia<C-R>="b\n"<CR>
> > > > >
> > > > > results:
> > > > > ab
> > > > > <empty line>
> > > > >
> > > > > This should be the expected behavior as I understand. But if I use
> > > > > instead:
> > > > > ia<C-R><C-O>="b\n"<CR>
> > > > >
> > > > > I get:
> > > > > b
> > > > > a
> > > > >
> > > > > Also:
> > > > >
> > > > > ia<C-R><C-R>="b\n"<CR>
> > > > > I get:
> > > > > ab^@
> > > > >
> > > > > -the ^@ is displayed instead of an empty new line.
> > > > >
> > > > > I'm using vim 8.0.540 on RHEL6. Please look into it.
> > > >
> > > > Vim offers those different commands to be able to insert different
> > > > things. So it's normal that they work differently.
> > > >
> > > > On top of that, it appears that in the second case the register is
> > > > recognized as linewise, since the text ends in a NL.
> > > >
> > >
> > > Hi Bram,
> > >
> > > I'm aware to the differences between these commands. According to the
> > > documentation both <C-R><C-R> and <C-R><C-O> insert the text literally
> > > and the only difference is if the formatting options are used or not. I
> > > don't see how formatting is related to my example or why one command uses
> > > a linewise register while the other is not.
> > >
> > > Also, I'm not sure if this is related, but I noticed that the results of
> > > the following two sequences are different:
> > > 1) ia<C-R><C-R>="b\n"<CR>
> > > 2) let @b="b\n"
> > > ia<C-R><C-R>b
> >
> > Yes, the first one evaluates an expression and inserts the result. The
> > second one assigns an expression to a register, where the trailing NL
> > causes it to become linewise. An expression itself is just a string,
> > a register can be linewise.
>
> Ok, but still why <C-R><C-O> considers the above b register (let @b="b\n")
> linewise while <C-R><C-R> not?
The documentation could be clearer about this. It mentions MiddleMouse,
but it's probably clearer to mention the "P" command.
I don't want to change the implementation, it's likely to cause
problems.
--
A KNIGHT rides into shot and hacks him to the ground. He rides off.
We stay for a moment on the glade. A MIDDLE-AGED LADY in a C. & A.
twin-set emerges from the trees and looks in horror at the body of her
HUSBAND.
MRS HISTORIAN: FRANK!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// 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.