On 6/15/06, Sylvain <[EMAIL PROTECTED]> wrote:
....
>
> Also, keep in mind that \n is stored as a NULL (which is the ^@) you are
> seeing.
What ? \n stored as a NULL ? I don't understand.. For me \n is 0x0A so what
you mean ?
Yes, \n when stored in a Vim variable/register/etc, is stored as a
NULL, and then translated back to a real newline under circumstances
such as "put". It's a confusing magical thing that Vim does for
legacy reasons, I think.
Try inserting a newline in insert mode, i.e. ^V^J (or ^Q^J if
you're using the mswin behavior). You will see a <00> show up.
Now do
let @a = "a" . "\n" . "b"
or
let @a = "a" . "\x0a" . "b"
and put it into the buffer using "ap or :put a You should see
a
b
Now do:
call setline(".", @a)
you should see:
a<00>b
It's not a happy reality, but there you go :-)