comparison src/testdir/test_mapping.vim @ 28333:04310f81143d v8.2.4692

patch 8.2.4692: no test for what 8.2.4691 fixes Commit: https://github.com/vim/vim/commit/0f68e6c07aaf62c034a242f183b93c1bb44e7f93 Author: zeertzjq <zeertzjq@outlook.com> Date: Tue Apr 5 13:17:01 2022 +0100 patch 8.2.4692: no test for what 8.2.4691 fixes Problem: No test for what 8.2.4691 fixes. Solution: Add a test. Use a more generic sotlution. (closes https://github.com/vim/vim/issues/10090)
author Bram Moolenaar <Bram@vim.org>
date Tue, 05 Apr 2022 14:30:03 +0200
parents 5147f3d3ed30
children a1de4ee8c40d
comparison
equal deleted inserted replaced
28332:609c7fb65969 28333:04310f81143d
1564 nunmap <F5> 1564 nunmap <F5>
1565 unlet g:foo 1565 unlet g:foo
1566 %bw! 1566 %bw!
1567 endfunc 1567 endfunc
1568 1568
1569 " Test for mapping <LeftDrag> in Insert mode
1570 func Test_mouse_drag_insert_map()
1571 set mouse=a
1572 func ClickExpr()
1573 call test_setmouse(1, 1)
1574 return "\<LeftMouse>"
1575 endfunc
1576 func DragExpr()
1577 call test_setmouse(1, 2)
1578 return "\<LeftDrag>"
1579 endfunc
1580 inoremap <expr> <F2> ClickExpr()
1581 imap <expr> <F3> DragExpr()
1582
1583 inoremap <LeftDrag> <LeftDrag><Cmd>let g:dragged = 1<CR>
1584 exe "normal i\<F2>\<F3>"
1585 call assert_equal(1, g:dragged)
1586 call assert_equal('v', mode())
1587 exe "normal! \<C-\>\<C-N>"
1588 unlet g:dragged
1589
1590 inoremap <LeftDrag> <LeftDrag><C-\><C-N>
1591 exe "normal i\<F2>\<F3>"
1592 call assert_equal('n', mode())
1593
1594 iunmap <LeftDrag>
1595 iunmap <F2>
1596 iunmap <F3>
1597 delfunc ClickExpr
1598 delfunc DragExpr
1599 set mouse&
1600 endfunc
1601
1569 " vim: shiftwidth=2 sts=2 expandtab 1602 " vim: shiftwidth=2 sts=2 expandtab