diff src/testdir/test_winbar.vim @ 28923:2d726d5a6405 v8.2.4984

patch 8.2.4984: dragging statusline fails for window with winbar Commit: https://github.com/vim/vim/commit/6dab00aa5417f62f8c2c85c7c4ae871b4f1171f4 Author: zeertzjq <zeertzjq@outlook.com> Date: Fri May 20 13:45:59 2022 +0100 patch 8.2.4984: dragging statusline fails for window with winbar Problem: Dragging statusline fails for window with winbar. Solution: Fix off-by-one error. (closes https://github.com/vim/vim/issues/10448)
author Bram Moolenaar <Bram@vim.org>
date Fri, 20 May 2022 15:00:05 +0200
parents 8938c0c98149
children bff3fa5f4c74
line wrap: on
line diff
--- a/src/testdir/test_winbar.vim
+++ b/src/testdir/test_winbar.vim
@@ -161,4 +161,32 @@ func Test_winbar_not_visible_custom_stat
   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