mirror of
https://github.com/vim/vim.git
synced 2025-07-04 23:07:33 -04:00
patch 8.2.1166: once mouse move events are enabled getchar() returns them
Problem: Once mouse move events are enabled getchar() returns them. Solution: Ignore K_MOUSEMOVE in getchar(). (closes #6424)
This commit is contained in:
parent
e4358906fd
commit
ae97b94176
@ -5023,8 +5023,9 @@ getchar([expr]) *getchar()*
|
|||||||
When the user clicks a mouse button, the mouse event will be
|
When the user clicks a mouse button, the mouse event will be
|
||||||
returned. The position can then be found in |v:mouse_col|,
|
returned. The position can then be found in |v:mouse_col|,
|
||||||
|v:mouse_lnum|, |v:mouse_winid| and |v:mouse_win|.
|
|v:mouse_lnum|, |v:mouse_winid| and |v:mouse_win|.
|
||||||
|getmousepos()| can also be used. This example positions the
|
|getmousepos()| can also be used. Mouse move events will be
|
||||||
mouse as it would normally happen: >
|
ignored.
|
||||||
|
This example positions the mouse as it would normally happen: >
|
||||||
let c = getchar()
|
let c = getchar()
|
||||||
if c == "\<LeftMouse>" && v:mouse_win > 0
|
if c == "\<LeftMouse>" && v:mouse_win > 0
|
||||||
exe v:mouse_win . "wincmd w"
|
exe v:mouse_win . "wincmd w"
|
||||||
|
@ -1501,7 +1501,7 @@ openscript(
|
|||||||
{
|
{
|
||||||
update_topline_cursor(); // update cursor position and topline
|
update_topline_cursor(); // update cursor position and topline
|
||||||
normal_cmd(&oa, FALSE); // execute one command
|
normal_cmd(&oa, FALSE); // execute one command
|
||||||
vpeekc(); // check for end of file
|
(void)vpeekc(); // check for end of file
|
||||||
}
|
}
|
||||||
while (scriptin[oldcurscript] != NULL);
|
while (scriptin[oldcurscript] != NULL);
|
||||||
|
|
||||||
@ -2045,7 +2045,7 @@ f_getchar(typval_T *argvars, typval_T *rettv)
|
|||||||
// getchar(0) and char avail: return char
|
// getchar(0) and char avail: return char
|
||||||
n = plain_vgetc();
|
n = plain_vgetc();
|
||||||
|
|
||||||
if (n == K_IGNORE)
|
if (n == K_IGNORE || n == K_MOUSEMOVE)
|
||||||
continue;
|
continue;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -754,6 +754,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1166,
|
||||||
/**/
|
/**/
|
||||||
1165,
|
1165,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user