]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1429: dragging outside the tabpanel changes tabpagenr v9.1.1429
authorHirohito Higashi <h.east.727@gmail.com>
Tue, 3 Jun 2025 19:07:25 +0000 (21:07 +0200)
committerChristian Brabandt <cb@256bit.org>
Tue, 3 Jun 2025 19:09:06 +0000 (21:09 +0200)
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.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/mouse.c
src/testdir/test_tabpanel.vim
src/version.c

index 0d05e643d32e2ebf29542951b571d8c3a48cbbdd..dcb6cbe1478fd74155f0b259b83475fa11fe9f51 100644 (file)
@@ -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
index c3288f8c1191c0a9b13fb80a98d0dddfa314b2cd..0d729a82e14d8b787f3555f08c17c426177843e8 100644 (file)
@@ -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()
index 7c3c4f12e08e2b2d9011a85795878dfe18eac7e8..5e34826e0b42864be3227821815f807bea35c328 100644 (file)
@@ -709,6 +709,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1429,
 /**/
     1428,
 /**/