patch 7.4.1894
Problem: Cannot get the window ID for a mouse click.
Solution: Add v:mouse_winid.
diff --git a/src/eval.c b/src/eval.c
index 66cf3a0..2a7a090 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -359,6 +359,7 @@
{VV_NAME("swapcommand", VAR_STRING), VV_RO},
{VV_NAME("char", VAR_STRING), 0},
{VV_NAME("mouse_win", VAR_NUMBER), 0},
+ {VV_NAME("mouse_winid", VAR_NUMBER), 0},
{VV_NAME("mouse_lnum", VAR_NUMBER), 0},
{VV_NAME("mouse_col", VAR_NUMBER), 0},
{VV_NAME("operator", VAR_STRING), VV_RO},
@@ -12755,6 +12756,7 @@
--allow_keys;
vimvars[VV_MOUSE_WIN].vv_nr = 0;
+ vimvars[VV_MOUSE_WINID].vv_nr = 0;
vimvars[VV_MOUSE_LNUM].vv_nr = 0;
vimvars[VV_MOUSE_COL].vv_nr = 0;
@@ -12810,6 +12812,7 @@
++winnr;
# endif
vimvars[VV_MOUSE_WIN].vv_nr = winnr;
+ vimvars[VV_MOUSE_WINID].vv_nr = win->w_id;
vimvars[VV_MOUSE_LNUM].vv_nr = lnum;
vimvars[VV_MOUSE_COL].vv_nr = col + 1;
}
diff --git a/src/version.c b/src/version.c
index 36b5ed7..b83cb33 100644
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1894,
+/**/
1893,
/**/
1892,
diff --git a/src/vim.h b/src/vim.h
index 55289aa..fb991dc 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -1887,26 +1887,27 @@
#define VV_SWAPCOMMAND 48
#define VV_CHAR 49
#define VV_MOUSE_WIN 50
-#define VV_MOUSE_LNUM 51
-#define VV_MOUSE_COL 52
-#define VV_OP 53
-#define VV_SEARCHFORWARD 54
-#define VV_HLSEARCH 55
-#define VV_OLDFILES 56
-#define VV_WINDOWID 57
-#define VV_PROGPATH 58
-#define VV_COMPLETED_ITEM 59
-#define VV_OPTION_NEW 60
-#define VV_OPTION_OLD 61
-#define VV_OPTION_TYPE 62
-#define VV_ERRORS 63
-#define VV_FALSE 64
-#define VV_TRUE 65
-#define VV_NULL 66
-#define VV_NONE 67
-#define VV_VIM_DID_ENTER 68
-#define VV_TESTING 69
-#define VV_LEN 70 /* number of v: vars */
+#define VV_MOUSE_WINID 51
+#define VV_MOUSE_LNUM 52
+#define VV_MOUSE_COL 53
+#define VV_OP 54
+#define VV_SEARCHFORWARD 55
+#define VV_HLSEARCH 56
+#define VV_OLDFILES 57
+#define VV_WINDOWID 58
+#define VV_PROGPATH 59
+#define VV_COMPLETED_ITEM 60
+#define VV_OPTION_NEW 61
+#define VV_OPTION_OLD 62
+#define VV_OPTION_TYPE 63
+#define VV_ERRORS 64
+#define VV_FALSE 65
+#define VV_TRUE 66
+#define VV_NULL 67
+#define VV_NONE 68
+#define VV_VIM_DID_ENTER 69
+#define VV_TESTING 70
+#define VV_LEN 71 /* number of v: vars */
/* used for v_number in VAR_SPECIAL */
#define VVAL_FALSE 0L