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 == "\<LeftMouse>" && 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 == "\<LeftMouse>" && 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 -- [email protected] -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202007091717.069HH1pG1694295%40masaka.moolenaar.net.

Raspunde prin e-mail lui