Dominique Pelle wrote:

> Compiling Vim-7.2.411 with gcc-4.5 using -Wlogical-op,
> I see this compilation warning which is a real bug in Vim:
> 
> normal.c:6526:5: warning: logical 'and' of mutually exclusive tests is
> always false
> 
> 6521 #ifdef FEAT_MOUSE
> 6522     /*
> 6523      * [ or ] followed by a middle mouse click: put selected text with
> 6524      * indent adjustment.  Any other button just does as usual.
> 6525      */
> 6526     else if (cap->nchar >= K_LEFTMOUSE && cap->nchar <= K_RIGHTRELEASE)
> 6527     {
> 6528         (void)do_mouse(cap->oap, cap->nchar,
> 6529                        (cap->cmdchar == ']') ? FORWARD : BACKWARD,
> 6530                        cap->count1, PUT_FIXINDENT);
> 6531     }
> 
> Adding a printf, I see that K_LEFTMOUSE and K_RIGHTRELEASE have the following
> *negative* values:
> 
>    K_LEFTMOUSE=-11517  K_RIGHTRELEASE=-13565
> 
> So condition at line normal.c:6526 is always false (bug).
> 
> ]<MiddleMouse>  in normal mode does not work as a result. It should
> do the same as  ]p  according to ":help ]p".
> 
> Attached patch fixes it.

Thanks, I'll include it.

-- 
I have a drinking problem -- I can't afford it.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.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

Raspunde prin e-mail lui