Patch 8.2.2932 (after 8.2.2930)
Problem:    Select mode test fails.
Solution:   Do not always reset the held mouse button.
Files:      src/mouse.c, src/normal.c, src/proto/normal.pro


*** ../vim-8.2.2931/src/mouse.c 2021-06-03 20:34:52.954850543 +0200
--- src/mouse.c 2021-06-03 22:09:35.942673112 +0200
***************
*** 477,483 ****
                if ((mod_mask & MOD_MASK_MULTI_CLICK) == MOD_MASK_2CLICK)
                {
                    // double click opens new page
!                   end_visual_mode();
                    tabpage_new();
                    tabpage_move(c1 == 0 ? 9999 : c1 - 1);
                }
--- 477,483 ----
                if ((mod_mask & MOD_MASK_MULTI_CLICK) == MOD_MASK_2CLICK)
                {
                    // double click opens new page
!                   end_visual_mode_keep_button();
                    tabpage_new();
                    tabpage_move(c1 == 0 ? 9999 : c1 - 1);
                }
***************
*** 489,495 ****
  
                    // It's like clicking on the status line of a window.
                    if (curwin != old_curwin)
!                       end_visual_mode();
                }
            }
            else
--- 489,495 ----
  
                    // It's like clicking on the status line of a window.
                    if (curwin != old_curwin)
!                       end_visual_mode_keep_button();
                }
            }
            else
***************
*** 1568,1574 ****
  #endif
        if (flags & MOUSE_MAY_STOP_VIS)
        {
!           end_visual_mode();
            redraw_curbuf_later(INVERTED);      // delete the inversion
        }
  #if defined(FEAT_CMDWIN) && defined(FEAT_CLIPBOARD)
--- 1568,1574 ----
  #endif
        if (flags & MOUSE_MAY_STOP_VIS)
        {
!           end_visual_mode_keep_button();
            redraw_curbuf_later(INVERTED);      // delete the inversion
        }
  #if defined(FEAT_CMDWIN) && defined(FEAT_CLIPBOARD)
***************
*** 1717,1723 ****
  #endif
                        && (flags & MOUSE_MAY_STOP_VIS))))
        {
!           end_visual_mode();
            redraw_curbuf_later(INVERTED);      // delete the inversion
        }
  #ifdef FEAT_CMDWIN
--- 1717,1723 ----
  #endif
                        && (flags & MOUSE_MAY_STOP_VIS))))
        {
!           end_visual_mode_keep_button();
            redraw_curbuf_later(INVERTED);      // delete the inversion
        }
  #ifdef FEAT_CMDWIN
***************
*** 1821,1827 ****
        // before moving the cursor for a left click, stop Visual mode
        if (flags & MOUSE_MAY_STOP_VIS)
        {
!           end_visual_mode();
            redraw_curbuf_later(INVERTED);      // delete the inversion
        }
  
--- 1821,1827 ----
        // before moving the cursor for a left click, stop Visual mode
        if (flags & MOUSE_MAY_STOP_VIS)
        {
!           end_visual_mode_keep_button();
            redraw_curbuf_later(INVERTED);      // delete the inversion
        }
  
*** ../vim-8.2.2931/src/normal.c        2021-06-03 20:34:52.958850534 +0200
--- src/normal.c        2021-06-03 22:10:51.246539994 +0200
***************
*** 1350,1360 ****
  
  /*
   * End Visual mode.
!  * This function should ALWAYS be called to end Visual mode, except from
!  * do_pending_operator().
   */
      void
! end_visual_mode(void)
  {
  #ifdef FEAT_CLIPBOARD
      /*
--- 1350,1367 ----
  
  /*
   * End Visual mode.
!  * This function or the next should ALWAYS be called to end Visual mode, 
except
!  * from do_pending_operator().
   */
      void
! end_visual_mode()
! {
!     end_visual_mode_keep_button();
!     reset_held_button();
! }
! 
!     void
! end_visual_mode_keep_button()
  {
  #ifdef FEAT_CLIPBOARD
      /*
***************
*** 1380,1386 ****
  #endif
  
      VIsual_active = FALSE;
-     reset_held_button();
      setmouse();
      mouse_dragging = 0;
  
--- 1387,1392 ----
*** ../vim-8.2.2931/src/proto/normal.pro        2019-12-12 12:55:28.000000000 
+0100
--- src/proto/normal.pro        2021-06-03 22:07:04.774995721 +0200
***************
*** 3,8 ****
--- 3,9 ----
  void normal_cmd(oparg_T *oap, int toplevel);
  void check_visual_highlight(void);
  void end_visual_mode(void);
+ void end_visual_mode_keep_button(void);
  void reset_VIsual_and_resel(void);
  void reset_VIsual(void);
  void restore_visual_mode(void);
*** ../vim-8.2.2931/src/version.c       2021-06-03 21:56:06.668423429 +0200
--- src/version.c       2021-06-03 22:10:15.126604341 +0200
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2932,
  /**/

-- 
So when I saw the post to comp.editors, I rushed over to the FTP site to
grab it.  So I yank apart the tarball, light x candles, where x= the
vim version multiplied by the md5sum of the source divided by the MAC of
my NIC (8A3FA78155A8A1D346C3C4A), put on black robes, dim the lights,
wave a dead chicken over the hard drive, and summon the power of GNU GCC
with the magic words "make config ; make!".
                [Jason Spence, compiling Vim 5.0]

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            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/202106032011.153KBk342934471%40masaka.moolenaar.net.

Raspunde prin e-mail lui