]> granicus.if.org Git - vim/commitdiff
patch 8.2.4818: no test for what 8.2.4806 fixes v8.2.4818
authorzeertzjq <zeertzjq@outlook.com>
Sun, 24 Apr 2022 14:58:30 +0000 (15:58 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 24 Apr 2022 14:58:30 +0000 (15:58 +0100)
Problem:    No test for what 8.2.4806 fixes.
Solution:   Add a test. (closes #10727)

src/testdir/test_mapping.vim
src/version.c

index a002126f16b60e6fedf9ec539cf01804f29583b1..7fdbdf6184b8739b9fe3d20b754990c38e487cd5 100644 (file)
@@ -1566,6 +1566,34 @@ func Test_plug_remap()
   %bw!
 endfunc
 
+func Test_mouse_drag_mapped_start_select()
+  set mouse=a
+  set selectmode=key,mouse
+  func ClickExpr()
+    call test_setmouse(1, 1)
+    return "\<LeftMouse>"
+  endfunc
+  func DragExpr()
+    call test_setmouse(1, 2)
+    return "\<LeftDrag>"
+  endfunc
+  nnoremap <expr> <F2> ClickExpr()
+  nmap <expr> <F3> DragExpr()
+
+  nnoremap <LeftDrag> <LeftDrag><Cmd><CR>
+  exe "normal \<F2>\<F3>"
+  call assert_equal('s', mode())
+  exe "normal! \<C-\>\<C-N>"
+
+  nunmap <LeftDrag>
+  nunmap <F2>
+  nunmap <F3>
+  delfunc ClickExpr
+  delfunc DragExpr
+  set selectmode&
+  set mouse&
+endfunc
+
 " Test for mapping <LeftDrag> in Insert mode
 func Test_mouse_drag_insert_map()
   set mouse=a
index e46816eddd1cc46954e7c449dd5beb70274d78e1..74b4625eb04863f3e6b7b7c2a51b9bae3763ccf2 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4818,
 /**/
     4817,
 /**/