Problem: Once mouse move events are enabled getchar() returns them.
Solution: Ignore K_MOUSEMOVE in getchar(). (closes #6424)
When the user clicks a mouse button, the mouse event will be
returned. The position can then be found in |v:mouse_col|,
|v:mouse_lnum|, |v:mouse_winid| and |v:mouse_win|.
- |getmousepos()| can also be used. This example positions the
- mouse as it would normally happen: >
+ |getmousepos()| can also be used. Mouse move events will be
+ ignored.
+ This example positions the mouse as it would normally happen: >
let c = getchar()
if c == "\<LeftMouse>" && v:mouse_win > 0
exe v:mouse_win . "wincmd w"
{
update_topline_cursor(); // update cursor position and topline
normal_cmd(&oa, FALSE); // execute one command
- vpeekc(); // check for end of file
+ (void)vpeekc(); // check for end of file
}
while (scriptin[oldcurscript] != NULL);
// getchar(0) and char avail: return char
n = plain_vgetc();
- if (n == K_IGNORE)
+ if (n == K_IGNORE || n == K_MOUSEMOVE)
continue;
break;
}
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1166,
/**/
1165,
/**/