call delete('XtestWinbarNotVisble')
endfunction
+func Test_drag_statusline_with_winbar()
+ call SetupWinbar()
+ let save_mouse = &mouse
+ set mouse=a
+ set laststatus=2
+
+ call test_setmouse(&lines - 1, 1)
+ call feedkeys("\<LeftMouse>", 'xt')
+ call test_setmouse(&lines - 2, 1)
+ call feedkeys("\<LeftDrag>", 'xt')
+ call assert_equal(2, &cmdheight)
+
+ call test_setmouse(&lines - 2, 1)
+ call feedkeys("\<LeftMouse>", 'xt')
+ call test_setmouse(&lines - 3, 1)
+ call feedkeys("\<LeftDrag>", 'xt')
+ call assert_equal(3, &cmdheight)
+
+ call test_setmouse(&lines - 3, 1)
+ call feedkeys("\<LeftMouse>", 'xt')
+ call test_setmouse(&lines - 1, 1)
+ call feedkeys("\<LeftDrag>", 'xt')
+ call assert_equal(1, &cmdheight)
+
+ let &mouse = save_mouse
+ set laststatus&
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab