To: vim_dev@googlegroups.com Subject: Patch 8.2.1166 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1166 Problem: Once mouse move events are enabled getchar() returns them. Solution: Ignore K_MOUSEMOVE in getchar(). (closes #6424) Files: runtime/doc/eval.txt, src/getchar.c *** ../vim-8.2.1165/runtime/doc/eval.txt 2020-06-17 21:41:31.969819222 +0200 --- runtime/doc/eval.txt 2020-07-09 19:11:55.108532145 +0200 *************** *** 5007,5014 **** 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: > let c = getchar() if c == "\" && v:mouse_win > 0 exe v:mouse_win . "wincmd w" --- 5030,5038 ---- 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. Mouse move events will be ! ignored. ! This example positions the mouse as it would normally happen: > let c = getchar() if c == "\" && v:mouse_win > 0 exe v:mouse_win . "wincmd w" *** ../vim-8.2.1165/src/getchar.c 2020-06-10 20:56:55.021354582 +0200 --- src/getchar.c 2020-07-09 19:10:53.048905671 +0200 *************** *** 1501,1507 **** { update_topline_cursor(); // update cursor position and topline normal_cmd(&oa, FALSE); // execute one command ! vpeekc(); // check for end of file } while (scriptin[oldcurscript] != NULL); --- 1501,1507 ---- { update_topline_cursor(); // update cursor position and topline normal_cmd(&oa, FALSE); // execute one command ! (void)vpeekc(); // check for end of file } while (scriptin[oldcurscript] != NULL); *************** *** 2045,2051 **** // getchar(0) and char avail: return char n = plain_vgetc(); ! if (n == K_IGNORE) continue; break; } --- 2045,2051 ---- // getchar(0) and char avail: return char n = plain_vgetc(); ! if (n == K_IGNORE || n == K_MOUSEMOVE) continue; break; } *** ../vim-8.2.1165/src/version.c 2020-07-09 18:49:19.395577627 +0200 --- src/version.c 2020-07-09 19:14:20.475687326 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1166, /**/ -- I learned the customs and mannerisms of engineers by observing them, much the way Jane Goodall learned about the great apes, but without the hassle of grooming. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///