1
0
forked from aniani/vim

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.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Hirohito Higashi 2025-06-03 21:07:25 +02:00 committed by Christian Brabandt
parent 86d46a7018
commit a1522f7c0d
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
3 changed files with 15 additions and 0 deletions

View 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

View 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()

View File

@ -709,6 +709,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1429,
/**/
1428,
/**/