mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-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 vim/vim#6424)
ae97b94176
This commit is contained in:
parent
51403d6d41
commit
f70ecbd4dc
@ -4316,8 +4316,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|. This
|
|v:mouse_lnum|, |v:mouse_winid| and |v:mouse_win|.
|
||||||
example positions the mouse as it would normally happen: >
|
Mouse move events will be 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"
|
||||||
|
@ -3016,7 +3016,10 @@ static void f_getchar(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
n = safe_vgetc();
|
n = safe_vgetc();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n == K_IGNORE || n == K_VER_SCROLLBAR || n == K_HOR_SCROLLBAR) {
|
if (n == K_IGNORE
|
||||||
|
|| n == K_MOUSEMOVE
|
||||||
|
|| n == K_VER_SCROLLBAR
|
||||||
|
|| n == K_HOR_SCROLLBAR) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1322,7 +1322,7 @@ void openscript(
|
|||||||
do {
|
do {
|
||||||
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);
|
||||||
|
|
||||||
State = save_State;
|
State = save_State;
|
||||||
|
Loading…
Reference in New Issue
Block a user