mirror of
https://github.com/vim/vim.git
synced 2025-10-26 09:14:23 -04:00
patch 9.1.1643: tabpanel: mouse code too complicated
Problem: tabpanel: mouse code too complicated Solution: Refactor code, adjust ifdefs (Hirohito Higashi). closes: #18023 Signed-off-by: Hirohito Higashi <h.east.727@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
0ebe55af54
commit
20a159b557
@@ -118,11 +118,33 @@ function Test_tabpanel_mouse()
|
||||
call feedkeys("\<LeftMouse>", 'xt')
|
||||
call assert_equal(3, tabpagenr())
|
||||
|
||||
" Drag the active tab page
|
||||
tablast
|
||||
call test_setmouse(3, 1)
|
||||
call feedkeys("\<LeftMouse>\<LeftDrag>", 'xt')
|
||||
call test_setmouse(2, 1)
|
||||
call feedkeys("\<LeftDrag>", 'xt')
|
||||
call assert_equal(3, tabpagenr())
|
||||
call feedkeys("\<LeftRelease>", 'xt')
|
||||
tabmove $
|
||||
|
||||
" Drag the inactive tab page
|
||||
tablast
|
||||
call test_setmouse(2, 1)
|
||||
call feedkeys("\<LeftMouse>\<LeftDrag>", 'xt')
|
||||
call test_setmouse(1, 1)
|
||||
call feedkeys("\<LeftDrag>", 'xt')
|
||||
call assert_equal(2, tabpagenr())
|
||||
call feedkeys("\<LeftRelease>", 'xt')
|
||||
tabmove 2
|
||||
|
||||
" Confirm that tabpagenr() does not change when dragging outside the tabpanel
|
||||
tablast
|
||||
call test_setmouse(3, 30)
|
||||
call feedkeys("\<LeftMouse>", 'xt')
|
||||
call feedkeys("\<LeftMouse>\<LeftDrag>", 'xt')
|
||||
call test_setmouse(1, 30)
|
||||
call feedkeys("\<LeftDrag>", 'xt')
|
||||
call feedkeys("\<LeftRelease>", 'xt')
|
||||
call assert_equal(3, tabpagenr())
|
||||
|
||||
call feedkeys("\<LeftMouse>", 'xt')
|
||||
|
||||
Reference in New Issue
Block a user