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("\<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
*** ../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 -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220520124638.10B401C0C46%40moolenaar.net.

Raspunde prin e-mail lui