Mercurial > vim
comparison runtime/doc/eval.txt @ 21230:e67123c115d2 v8.2.1166
patch 8.2.1166: once mouse move events are enabled getchar() returns them
Commit: https://github.com/vim/vim/commit/ae97b94176062d30ea8c68bb83cde034c5150c78
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jul 9 19:16:35 2020 +0200
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 https://github.com/vim/vim/issues/6424)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 09 Jul 2020 19:30:04 +0200 |
parents | 99a602b27e0e |
children | 21fb2a3ad3ca |
comparison
equal
deleted
inserted
replaced
21229:c383383768f4 | 21230:e67123c115d2 |
---|---|
5021 Use getcharmod() to obtain any additional modifiers. | 5021 Use getcharmod() to obtain any additional modifiers. |
5022 | 5022 |
5023 When the user clicks a mouse button, the mouse event will be | 5023 When the user clicks a mouse button, the mouse event will be |
5024 returned. The position can then be found in |v:mouse_col|, | 5024 returned. The position can then be found in |v:mouse_col|, |
5025 |v:mouse_lnum|, |v:mouse_winid| and |v:mouse_win|. | 5025 |v:mouse_lnum|, |v:mouse_winid| and |v:mouse_win|. |
5026 |getmousepos()| can also be used. This example positions the | 5026 |getmousepos()| can also be used. Mouse move events will be |
5027 mouse as it would normally happen: > | 5027 ignored. |
5028 This example positions the mouse as it would normally happen: > | |
5028 let c = getchar() | 5029 let c = getchar() |
5029 if c == "\<LeftMouse>" && v:mouse_win > 0 | 5030 if c == "\<LeftMouse>" && v:mouse_win > 0 |
5030 exe v:mouse_win . "wincmd w" | 5031 exe v:mouse_win . "wincmd w" |
5031 exe v:mouse_lnum | 5032 exe v:mouse_lnum |
5032 exe "normal " . v:mouse_col . "|" | 5033 exe "normal " . v:mouse_col . "|" |