]> granicus.if.org Git - vim/commitdiff
patch 8.2.2930: when a popup is visible a mouse move my restart Visual mode v8.2.2930
authorBram Moolenaar <Bram@vim.org>
Thu, 3 Jun 2021 18:34:57 +0000 (20:34 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 3 Jun 2021 18:34:57 +0000 (20:34 +0200)
Problem:    When a popup is visible a mouse move my restart Visual mode.
Solution:   Reset held_button when ending Visual mode. (closes #8318)

src/mouse.c
src/normal.c
src/proto/mouse.pro
src/version.c

index 4bff48e768d968281ddc5ff3a57e821c3c62199a..f1c1aabbc826667dc5f5cdb53c72d7e1fefd79c2 100644 (file)
@@ -2098,6 +2098,14 @@ nv_mouse(cmdarg_T *cap)
     (void)do_mouse(cap->oap, cap->cmdchar, BACKWARD, cap->count1, 0);
 }
 
+static int     held_button = MOUSE_RELEASE;
+
+    void
+reset_held_button()
+{
+    held_button = MOUSE_RELEASE;
+}
+
 /*
  * Check if typebuf 'tp' contains a terminal mouse code and returns the
  * modifiers found in typebuf in 'modifiers'.
@@ -2123,7 +2131,6 @@ check_termcode_mouse(
     int                is_release, release_is_ambiguous;
     int                wheel_code = 0;
     int                current_button;
-    static int held_button = MOUSE_RELEASE;
     static int orig_num_clicks = 1;
     static int orig_mouse_code = 0x0;
 # ifdef CHECK_DOUBLE_CLICK
index cb496dd1f001e1013ed0e24dc9cbcb262e2c202c..f8ec8e9ce32b8be6cea6bb6df35bf0425fd44ea6 100644 (file)
@@ -1380,6 +1380,7 @@ end_visual_mode(void)
 #endif
 
     VIsual_active = FALSE;
+    reset_held_button();
     setmouse();
     mouse_dragging = 0;
 
index f2a8c3829cee6246e2125570bc56df40b500b5c6..37a2f07cb6baf80160c0129141a78d7facce5fe3 100644 (file)
@@ -13,6 +13,7 @@ int mouse_model_popup(void);
 int jump_to_mouse(int flags, int *inclusive, int which_button);
 void nv_mousescroll(cmdarg_T *cap);
 void nv_mouse(cmdarg_T *cap);
+void reset_held_button(void);
 int check_termcode_mouse(char_u *tp, int *slen, char_u *key_name, char_u *modifiers_start, int idx, int *modifiers);
 int mouse_comp_pos(win_T *win, int *rowp, int *colp, linenr_T *lnump, int *plines_cache);
 win_T *mouse_find_win(int *rowp, int *colp, mouse_find_T popup);
index 28907ee647253e0ec53c35d8091e5c628504c443..f89a1490f1d1f5c6a67531562ff4d7284ca775f4 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2930,
 /**/
     2929,
 /**/