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'. It's more complicated to remember the previous value, then set v:register to '_' while the operation is being executed, then restore the previous value. An alternative would be to have another variable that holds the last register that isn't the black hole register. Not sure how useful that would be. -- >From "know your smileys": :-* A big kiss! /// 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.
