Hi Ingo!

On Mo, 03 Sep 2012, Ingo Karkat wrote:

> Hello Vim developers,
> 
> This issue came up on Reddit
> (http://www.reddit.com/r/vim/comments/yyq4a/is_there_anyway_to_configure_vim_to_use_the/).
> 
> With :set clipboard=unnamed, small deletes (such as "dw") affect the named
> registers "1.."9. I can reproduce this with vanilla Vim 7.3.000 on 
> Windows/x86,
> and the latest Vim 7.3.646 on Ubuntu/x86.
> 
> It appears that the setting triggers the exception from the rule "This 
> register
> ("-) contains text from commands that delete less than one line, except when 
> the
> command specifies a register with ["x].", although the register here comes 
> from
> the implementation, not the user.
> 
> Based on the Reddit posting, some people apparently prefer this behavior 
> (though
> I personally dislike that multiple "x" commands will rapidly fill the number
> registers with single characters), so maybe there should be (yet another) 
> option
> for that. ('smalldeletethreshold', with 0 = off, 1 = all, and N = for deletes
> equal or larger than N characters?!)

This patch just fixes this side effect. I don't think, it warrants yet 
another option.

diff --git a/src/ops.c b/src/ops.c
--- a/src/ops.c
+++ b/src/ops.c
@@ -1716,8 +1716,8 @@
         * Put deleted text into register 1 and shift number registers if the
         * delete contains a line break, or when a regname has been specified.
         */
-       if (oap->regname != 0 || oap->motion_type == MLINE
-                                  || oap->line_count > 1 || oap->use_reg_one)
+       if (oap->regname != 0 && (oap->motion_type == MLINE
+                                  || oap->line_count > 1 || oap->use_reg_one))
        {
            y_current = &y_regs[9];
            free_yank_all();                    /* free register nine */


regards,
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

Raspunde prin e-mail lui