Patch 8.2.1186
Problem:    With SGR mouse codes balloon doesn't show up after click.
Solution:   Add the MOUSE_RELEASE bits to mouse_code.
Files:      src/mouse.c


*** ../vim-8.2.1185/src/mouse.c 2020-07-01 15:49:26.300450527 +0200
--- src/mouse.c 2020-07-12 13:46:22.784242948 +0200
***************
*** 2145,2152 ****
         )
      {
        /*
!        * For xterm we get "<t_mouse>scr", where
!        *  s == encoded button state:
         *         0x20 = left button down
         *         0x21 = middle button down
         *         0x22 = right button down
--- 2145,2151 ----
         )
      {
        /*
!        * For xterm we get "<t_mouse>scr", where s == encoded button state:
         *         0x20 = left button down
         *         0x21 = middle button down
         *         0x22 = right button down
***************
*** 2162,2170 ****
         *  c == column + ' ' + 1 == column + 33
         *  r == row + ' ' + 1 == row + 33
         *
!        * The coordinates are passed on through global variables.
!        * Ugly, but this avoids trouble with mouse clicks at an
!        * unexpected moment and allows for mapping them.
         */
        for (;;)
        {
--- 2161,2169 ----
         *  c == column + ' ' + 1 == column + 33
         *  r == row + ' ' + 1 == row + 33
         *
!        * The coordinates are passed on through global variables.  Ugly, but
!        * this avoids trouble with mouse clicks at an unexpected moment and
!        * allows for mapping them.
         */
        for (;;)
        {
***************
*** 2193,2201 ****
            }
            *slen += num_bytes;
  
!           // If the following bytes is also a mouse code and it has
!           // the same code, dump this one and get the next.  This
!           // makes dragging a whole lot faster.
  #  ifdef FEAT_GUI
            if (gui.in_use)
                j = 3;
--- 2192,2200 ----
            }
            *slen += num_bytes;
  
!           // If the following bytes is also a mouse code and it has the same
!           // code, dump this one and get the next.  This makes dragging a
!           // whole lot faster.
  #  ifdef FEAT_GUI
            if (gui.in_use)
                j = 3;
***************
*** 2223,2230 ****
            || key_name[0] == KS_SGR_MOUSE_RELEASE)
      {
        // URXVT 1015 mouse reporting mode:
!       // Almost identical to xterm mouse mode, except the values
!       // are decimal instead of bytes.
        //
        // \033[%d;%d;%dM
        //             ^-- row
--- 2222,2229 ----
            || key_name[0] == KS_SGR_MOUSE_RELEASE)
      {
        // URXVT 1015 mouse reporting mode:
!       // Almost identical to xterm mouse mode, except the values are decimal
!       // instead of bytes.
        //
        // \033[%d;%d;%dM
        //             ^-- row
***************
*** 2232,2239 ****
        //       ^-------- code
        //
        // SGR 1006 mouse reporting mode:
!       // Almost identical to xterm mouse mode, except the values
!       // are decimal instead of bytes.
        //
        // \033[<%d;%d;%dM
        //             ^-- row
--- 2231,2238 ----
        //       ^-------- code
        //
        // SGR 1006 mouse reporting mode:
!       // Almost identical to xterm mouse mode, except the values are decimal
!       // instead of bytes.
        //
        // \033[<%d;%d;%dM
        //             ^-- row
***************
*** 2263,2270 ****
  
        mouse_row = getdigits(&p) - 1;
  
!       // The modifiers were the mouse coordinates, not the
!       // modifier keys (alt/shift/ctrl/meta) state.
        *modifiers = 0;
      }
  
--- 2262,2269 ----
  
        mouse_row = getdigits(&p) - 1;
  
!       // The modifiers were the mouse coordinates, not the modifier keys
!       // (alt/shift/ctrl/meta) state.
        *modifiers = 0;
      }
  
***************
*** 2272,2278 ****
--- 2271,2281 ----
            || key_name[0] == KS_SGR_MOUSE_RELEASE)
      {
        if (key_name[0] == KS_SGR_MOUSE_RELEASE)
+       {
            is_release = TRUE;
+           // This is used below to set held_button.
+           mouse_code |= MOUSE_RELEASE;
+       }
      }
      else
      {
***************
*** 2293,2299 ****
      {
  #  if !defined(MSWIN)
        /*
!        * Handle mouse events.
         * Recognize the xterm mouse wheel, but not in the GUI, the
         * Linux console with GPM and the MS-DOS or Win32 console
         * (multi-clicks use >= 0x60).
--- 2296,2302 ----
      {
  #  if !defined(MSWIN)
        /*
!        * Handle old style mouse events.
         * Recognize the xterm mouse wheel, but not in the GUI, the
         * Linux console with GPM and the MS-DOS or Win32 console
         * (multi-clicks use >= 0x60).
***************
*** 2384,2391 ****
         * (L-x)  Left button pressed - not pressed x not reporting
         * (M-x)  Middle button pressed - not pressed x not reporting
         * (R-x)  Right button pressed - not pressed x not reporting
!        * (SDmdu)  Single , Double click, m mouse move d button down
!        *                                                 u button up
         *  ###   X cursor position padded to 3 digits
         *  ###   Y cursor position padded to 3 digits
         * (s-x)  SHIFT key pressed - not pressed x not reporting
--- 2387,2394 ----
         * (L-x)  Left button pressed - not pressed x not reporting
         * (M-x)  Middle button pressed - not pressed x not reporting
         * (R-x)  Right button pressed - not pressed x not reporting
!        * (SDmdu)  Single , Double click, m: mouse move, d: button down,
!                     *                                            u: button up
         *  ###   X cursor position padded to 3 digits
         *  ###   Y cursor position padded to 3 digits
         * (s-x)  SHIFT key pressed - not pressed x not reporting
***************
*** 2516,2525 ****
         * Pp is the third coordinate (page number)
         * Pe, the event code indicates what event caused this report
         *    The following event codes are defined:
!        *    0 - request, the terminal received an explicit request
!        *       for a locator report, but the locator is unavailable
!        *    1 - request, the terminal received an explicit request
!        *       for a locator report
         *    2 - left button down
         *    3 - left button up
         *    4 - middle button down
--- 2519,2528 ----
         * Pp is the third coordinate (page number)
         * Pe, the event code indicates what event caused this report
         *    The following event codes are defined:
!        *    0 - request, the terminal received an explicit request for a
!        *        locator report, but the locator is unavailable
!        *    1 - request, the terminal received an explicit request for a
!        *        locator report
         *    2 - left button down
         *    3 - left button up
         *    4 - middle button down
***************
*** 2529,2556 ****
         *    8 - fourth button down
         *    9 - fourth button up
         *    10 - locator outside filter rectangle
!        * Pb, the button code, ASCII decimal 0-15 indicating which
!        *   buttons are down if any. The state of the four buttons
!        *   on the locator correspond to the low four bits of the
!        *   decimal value,
!        *   "1" means button depressed
         *   0 - no buttons down,
         *   1 - right,
         *   2 - middle,
         *   4 - left,
         *   8 - fourth
         * Pr is the row coordinate of the locator position in the page,
!        *   encoded as an ASCII decimal value.
!        *   If Pr is omitted, the locator position is undefined
!        *   (outside the terminal window for example).
!        * Pc is the column coordinate of the locator position in the
!        *   page, encoded as an ASCII decimal value.
!        *   If Pc is omitted, the locator position is undefined
!        *   (outside the terminal window for example).
!        * Pp is the page coordinate of the locator position
!        *   encoded as an ASCII decimal value.
!        *   The page coordinate may be omitted if the locator is on
!        *   page one (the default).  We ignore it anyway.
         */
        int Pe, Pb, Pr, Pc;
  
--- 2532,2555 ----
         *    8 - fourth button down
         *    9 - fourth button up
         *    10 - locator outside filter rectangle
!        * Pb, the button code, ASCII decimal 0-15 indicating which buttons are
!        *   down if any. The state of the four buttons on the locator
!        *   correspond to the low four bits of the decimal value, "1" means
!        *   button depressed
         *   0 - no buttons down,
         *   1 - right,
         *   2 - middle,
         *   4 - left,
         *   8 - fourth
         * Pr is the row coordinate of the locator position in the page,
!        *   encoded as an ASCII decimal value.  If Pr is omitted, the locator
!        *   position is undefined (outside the terminal window for example).
!        * Pc is the column coordinate of the locator position in the page,
!        *   encoded as an ASCII decimal value.  If Pc is omitted, the locator
!        *   position is undefined (outside the terminal window for example).
!        * Pp is the page coordinate of the locator position encoded as an
!        *   ASCII decimal value.  The page coordinate may be omitted if the
!        *   locator is on page one (the default).  We ignore it anyway.
         */
        int Pe, Pb, Pr, Pc;
  
***************
*** 2707,2718 ****
         )
      {
        /*
!        * If we get a mouse drag or release event when
!        * there is no mouse button held down (held_button ==
!        * MOUSE_RELEASE), produce a K_IGNORE below.
!        * (can happen when you hold down two buttons
!        * and then let them go, or click in the menu bar, but not
!        * on a menu, and drag into the text).
         */
        if ((mouse_code & MOUSE_DRAG) == MOUSE_DRAG)
            is_drag = TRUE;
--- 2706,2716 ----
         )
      {
        /*
!        * If we get a mouse drag or release event when there is no mouse
!        * button held down (held_button == MOUSE_RELEASE), produce a K_IGNORE
!        * below.
!        * (can happen when you hold down two buttons and then let them go, or
!        * click in the menu bar, but not on a menu, and drag into the text).
         */
        if ((mouse_code & MOUSE_DRAG) == MOUSE_DRAG)
            is_drag = TRUE;
***************
*** 2723,2730 ****
  # ifdef CHECK_DOUBLE_CLICK
  #  ifdef FEAT_MOUSE_GPM
        /*
!        * Only for Unix, when GUI not active, we handle
!        * multi-clicks here, but not for GPM mouse events.
         */
  #   ifdef FEAT_GUI
        if (key_name[0] != KS_GPM_MOUSE && !gui.in_use)
--- 2721,2728 ----
  # ifdef CHECK_DOUBLE_CLICK
  #  ifdef FEAT_MOUSE_GPM
        /*
!        * Only for Unix, when GUI not active, we handle multi-clicks here, but
!        * not for GPM mouse events.
         */
  #   ifdef FEAT_GUI
        if (key_name[0] != KS_GPM_MOUSE && !gui.in_use)
***************
*** 2801,2808 ****
      else if (orig_num_clicks == 4)
        *modifiers |= MOD_MASK_4CLICK;
  
!     // Work out our pseudo mouse event. Note that MOUSE_RELEASE gets
!     // added, then it's not mouse up/down.
      key_name[0] = KS_EXTRA;
      if (wheel_code != 0 && (!is_release || release_is_ambiguous))
      {
--- 2799,2806 ----
      else if (orig_num_clicks == 4)
        *modifiers |= MOD_MASK_4CLICK;
  
!     // Work out our pseudo mouse event. Note that MOUSE_RELEASE gets added,
!     // then it's not mouse up/down.
      key_name[0] = KS_EXTRA;
      if (wheel_code != 0 && (!is_release || release_is_ambiguous))
      {
***************
*** 2823,2833 ****
        held_button = MOUSE_RELEASE;
      }
      else
!       key_name[1] = get_pseudo_mouse_code(current_button,
!               is_click, is_drag);
  
!     // Make sure the mouse position is valid.  Some terminals may
!     // return weird values.
      if (mouse_col >= Columns)
        mouse_col = Columns - 1;
      if (mouse_row >= Rows)
--- 2821,2831 ----
        held_button = MOUSE_RELEASE;
      }
      else
!       key_name[1] = get_pseudo_mouse_code(current_button, is_click, is_drag);
! 
  
!     // Make sure the mouse position is valid.  Some terminals may return weird
!     // values.
      if (mouse_col >= Columns)
        mouse_col = Columns - 1;
      if (mouse_row >= Rows)
*** ../vim-8.2.1185/src/version.c       2020-07-11 22:49:56.047213793 +0200
--- src/version.c       2020-07-12 13:39:27.981501410 +0200
***************
*** 756,757 ****
--- 756,759 ----
  {   /* Add new patch number below this line */
+ /**/
+     1186,
  /**/

-- 
The Feynman problem solving Algorithm:
        1) Write down the problem
        2) Think real hard
        3) Write down the answer

 /// 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/202007121148.06CBmFPP2455449%40masaka.moolenaar.net.

Raspunde prin e-mail lui