Commit: patch 9.1.1429: dragging outside the tabpanel changes tabpagenr

1 view
Skip to first unread message

Christian Brabandt

unread,
Jun 3, 2025, 3:15:17 PM6/3/25
to vim...@googlegroups.com
patch 9.1.1429: dragging outside the tabpanel changes tabpagenr

Commit: https://github.com/vim/vim/commit/a1522f7c0daeddf91cdb7313bdcccd3b3774e39e
Author: Hirohito Higashi <h.eas...@gmail.com>
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 <h.eas...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

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,
/**/
Reply all
Reply to author
Forward
0 new messages