]> granicus.if.org Git - vim/commitdiff
patch 8.2.3681: cannot drag popup window after click on a status line v8.2.3681
authorBram Moolenaar <Bram@vim.org>
Fri, 26 Nov 2021 15:57:40 +0000 (15:57 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 26 Nov 2021 15:57:40 +0000 (15:57 +0000)
Problem:    Cannot drag popup window after click on a status line. (Sergey
            Vlasov)
Solution:   Reset on_status_line. (closes #9221)

src/mouse.c
src/testdir/dumps/Test_popupwin_drag_04.dump [new file with mode: 0644]
src/testdir/test_popupwin.vim
src/version.c

index c17e26a3d6874aa55f8f4763a591a5244cbd27bb..77de8d584208834a78727f194967133bdc5b021c 100644 (file)
@@ -1630,6 +1630,7 @@ retnomove:
        if (WIN_IS_POPUP(wp))
        {
            on_sep_line = 0;
+           on_status_line = 0;
            in_popup_win = TRUE;
            if (which_button == MOUSE_LEFT && popup_close_if_on_X(wp, row, col))
            {
diff --git a/src/testdir/dumps/Test_popupwin_drag_04.dump b/src/testdir/dumps/Test_popupwin_drag_04.dump
new file mode 100644 (file)
index 0000000..931e13c
--- /dev/null
@@ -0,0 +1,10 @@
+>1+0&#ffffff0| @35||+1&&|1+0&&| @35
+|2| @15|╔+0#0000001#ffd7ff255|═@9|╗| +0#0000000#ffffff0@7||+1&&|2+0&&| @35
+|3| @15|║+0#0000001#ffd7ff255|1@3| @5|║| +0#0000000#ffffff0@7||+1&&|3+0&&| @35
+|4| @15|║+0#0000001#ffd7ff255|2@5| @3|║| +0#0000000#ffffff0@7||+1&&|4+0&&| @35
+|[+3&&|N|o| |N|a|m|e|]| |[|+|]| @3|║+0#0000001#ffd7ff255|3@4| @4|║| +3#0000000#ffffff0@4|T|o|p| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @5|1|,|1| @11|T|o|p
+|1+0&&| @15|║+0#0000001#ffd7ff255| +0#4040ff13&@9|║+0#0000001&| +0#0000000#ffffff0@7||+1&&|1+0&&| @35
+|2| @15|╚+0#0000001#ffd7ff255|═@9|⇲| +0#0000000#ffffff0@7||+1&&|2+0&&| @35
+|3| @35||+1&&|3+0&&| @35
+|[+1&&|N|o| |N|a|m|e|]| |[|+|]| @5|1|,|1| @11|T|o|p| |[|N|o| |N|a|m|e|]| |[|+|]| @5|1|,|1| @11|T|o|p
+|:+0&&|c|a|l@1| |C|l|i|c|k|A|n|d|D|r|a|g|(|)| @54
index 15fa3ca0660e6f7188e67e3043fac4a96faf44c3..3b38102ddb21d61fc4468af8198951df1d6e4b82 100644 (file)
@@ -574,6 +574,13 @@ func Test_popup_drag()
        endfunc
        map <silent> <F5> :call test_setmouse(6, 21)<CR>
        map <silent> <F6> :call test_setmouse(7, 25)<CR>
+       func ClickAndDrag()
+         call feedkeys("\<F7>\<LeftMouse>\<LeftRelease>", "xt")
+         call feedkeys("\<F8>\<LeftMouse>\<F9>\<LeftDrag>\<LeftRelease>", "xt")
+       endfunc
+       map <silent> <F7> :call test_setmouse(5, 2)<CR>
+       map <silent> <F8> :call test_setmouse(3, 14)<CR>
+       map <silent> <F9> :call test_setmouse(3, 18)<CR>
   END
   call writefile(lines, 'XtestPopupDrag')
   let buf = RunVimInTerminal('-S XtestPopupDrag', #{rows: 10})
@@ -585,6 +592,10 @@ func Test_popup_drag()
   call term_sendkeys(buf, ":call Resize()\<CR>")
   call VerifyScreenDump(buf, 'Test_popupwin_drag_03', {})
 
+  " dragging works after click on a status line
+  call term_sendkeys(buf, ":call ClickAndDrag()\<CR>")
+  call VerifyScreenDump(buf, 'Test_popupwin_drag_04', {})
+
   " clean up
   call StopVimInTerminal(buf)
   call delete('XtestPopupDrag')
index 31c252081bd072044b0d55fee368103b8fe2625a..532b59e825463635152500c6b2f09bd4d752681d 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3681,
 /**/
     3680,
 /**/