summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-06-03 20:34:57 +0200
committerBram Moolenaar <Bram@vim.org>2021-06-03 20:34:57 +0200
commit85eee5b969485142b54337cadadd65a38e7d7396 (patch)
tree567e41e984bb7da60b1a3ec18123bdd83e4006d9
parent0a808598e4edb3f1a167ac8c5c1f9084af625c4d (diff)
downloadvim-git-85eee5b969485142b54337cadadd65a38e7d7396.tar.gz
patch 8.2.2930: when a popup is visible a mouse move my restart Visual modev8.2.2930
Problem: When a popup is visible a mouse move my restart Visual mode. Solution: Reset held_button when ending Visual mode. (closes #8318)
-rw-r--r--src/mouse.c9
-rw-r--r--src/normal.c1
-rw-r--r--src/proto/mouse.pro1
-rw-r--r--src/version.c2
4 files changed, 12 insertions, 1 deletions
diff --git a/src/mouse.c b/src/mouse.c
index 4bff48e76..f1c1aabbc 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -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
diff --git a/src/normal.c b/src/normal.c
index cb496dd1f..f8ec8e9ce 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -1380,6 +1380,7 @@ end_visual_mode(void)
#endif
VIsual_active = FALSE;
+ reset_held_button();
setmouse();
mouse_dragging = 0;
diff --git a/src/proto/mouse.pro b/src/proto/mouse.pro
index f2a8c3829..37a2f07cb 100644
--- a/src/proto/mouse.pro
+++ b/src/proto/mouse.pro
@@ -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);
diff --git a/src/version.c b/src/version.c
index 28907ee64..f89a1490f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2930,
+/**/
2929,
/**/
2928,