patch 9.1.1429: dragging outside the tabpanel changes tabpagenr
Commit:
https://github.com/vim/vim/commit/a1522f7c0daeddf91cdb7313bdcccd3b3774e39e
Author: Hirohito Higashi <[email protected]>
Date: Tue Jun 3 21:07:25 2025 +0200
patch 9.1.1429: dragging outside the tabpanel changes tabpagenr
Problem: dragging outside the tabpanel changes tabpagenr (char101)
Solution: set in_tab_line and in_tabpanel variables (Hirohito Higashi)
fixes: #17385
closes: #17431
Signed-off-by: Hirohito Higashi <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/src/mouse.c b/src/mouse.c
index 0d05e643d..dcb6cbe14 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -337,7 +337,13 @@ do_mouse(
// Ignore drag and release events if we didn't get a click.
if (is_click)
+ {
got_click = TRUE;
+ in_tab_line = FALSE;
+#if defined(FEAT_TABPANEL)
+ in_tabpanel = FALSE;
+#endif
+ }
else
{
if (!got_click) // didn't get click, ignore
diff --git a/src/testdir/test_tabpanel.vim b/src/testdir/test_tabpanel.vim
index c3288f8c1..0d729a82e 100644
--- a/src/testdir/test_tabpanel.vim
+++ b/src/testdir/test_tabpanel.vim
@@ -92,6 +92,13 @@ function Test_tabpanel_mouse()
call feedkeys("\<LeftMouse>", 'xt')
call assert_equal(3, tabpagenr())
+ " Confirm that tabpagenr() does not change when dragging outside the tabpanel
+ call test_setmouse(3, 30)
+ call feedkeys("\<LeftMouse>", 'xt')
+ call test_setmouse(1, 30)
+ call feedkeys("\<LeftDrag>", 'xt')
+ call assert_equal(3, tabpagenr())
+
call feedkeys("\<LeftMouse>", 'xt')
call test_setmouse(2, 3)
let pos = getmousepos()
diff --git a/src/version.c b/src/version.c
index 7c3c4f12e..5e34826e0 100644
--- a/src/version.c
+++ b/src/version.c
@@ -709,6 +709,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1429,
/**/
1428,
/**/
--
--
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 visit
https://groups.google.com/d/msgid/vim_dev/E1uMX6J-00Fdk7-Ck%40256bit.org.