To: vim_dev@googlegroups.com Subject: Patch 8.2.4984 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4984 Problem: Dragging statusline fails for window with winbar. Solution: Fix off-by-one error. (closes #10448) Files: src/mouse.c, src/testdir/test_winbar.vim *** ../vim-8.2.4983/src/mouse.c 2022-05-09 20:09:19.290641428 +0100 --- src/mouse.c 2022-05-20 13:43:55.397406260 +0100 *************** *** 1823,1829 **** if (dragwin != NULL) { // Drag the status line ! count = row - dragwin->w_winrow - dragwin->w_height + 1 - on_status_line; win_drag_status_line(dragwin, count); did_drag |= count; --- 1823,1829 ---- if (dragwin != NULL) { // Drag the status line ! count = row - W_WINROW(dragwin) - dragwin->w_height + 1 - on_status_line; win_drag_status_line(dragwin, count); did_drag |= count; *** ../vim-8.2.4983/src/testdir/test_winbar.vim 2021-04-01 15:15:59.184829183 +0100 --- src/testdir/test_winbar.vim 2022-05-20 13:43:55.397406260 +0100 *************** *** 161,164 **** --- 161,192 ---- 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("\", 'xt') + call test_setmouse(&lines - 2, 1) + call feedkeys("\", 'xt') + call assert_equal(2, &cmdheight) + + call test_setmouse(&lines - 2, 1) + call feedkeys("\", 'xt') + call test_setmouse(&lines - 3, 1) + call feedkeys("\", 'xt') + call assert_equal(3, &cmdheight) + + call test_setmouse(&lines - 3, 1) + call feedkeys("\", 'xt') + call test_setmouse(&lines - 1, 1) + call feedkeys("\", 'xt') + call assert_equal(1, &cmdheight) + + let &mouse = save_mouse + set laststatus& + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.4983/src/version.c 2022-05-20 10:39:14.832585770 +0100 --- src/version.c 2022-05-20 13:45:38.809399132 +0100 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 4984, /**/ -- hundred-and-one symptoms of being an internet addict: 239. You think "surfing" is something you do on dry land. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///