Am 2014-04-29 23:03, schrieb Bram Moolenaar:
Christian Brabandt wrote:

Hi Andrew!

On Di, 29 Apr 2014, Andrew wrote:

> Hi, Christian,
>
> > Can you please come up with a mapping that shows the wrong behaviour?
>
> I made this example: https://gist.github.com/AndrewRadev/11408444
>
> It's supposed to paste some text and comment it in the process. It's kind of 
silly, but a realistic enough example. If you `"_dd` anything and then immediately 
perform a `gp`, nothing happens, since the `v:register` variable is set to `_`. If 
you've managed ot fix the issue, it should paste normally, from the default register.

Thanks. I think this one fixes it:

diff --git a/src/normal.c b/src/normal.c
--- a/src/normal.c
+++ b/src/normal.c
@@ -1263,6 +1263,10 @@ getcount:
 normal_end:

     msg_nowait = FALSE;
+#ifdef FEAT_EVAL
+    /* reset v:register */
+    set_reg_var(0);
+#endif

     /* Reset finish_op, in case it was set */
 #ifdef CURSOR_SHAPE

(I hope, it doesn't have any side effect).

Well, if one first does "add  and then "_dd, it's a bit unexpected that
v:register is then '"' and not '_' or 'a'.

I am not sure I follow. Why would one expect v:register to hold the register name from the previous
normal mode command?

Best,
Christian

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

Raspunde prin e-mail lui