Mercurial > vim
annotate src/testdir/test_mapping.vim @ 16235:219c58b3879c v8.1.1122
patch 8.1.1122: char2nr() does not handle composing characters
commit https://github.com/vim/vim/commit/9d40128afd7fcd038ff6532722b55b1a8c189ce8
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Apr 6 13:18:12 2019 +0200
patch 8.1.1122: char2nr() does not handle composing characters
Problem: char2nr() does not handle composing characters.
Solution: Add str2list() and list2str(). (Ozaki Kiichi, closes https://github.com/vim/vim/issues/4190)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 06 Apr 2019 13:30:04 +0200 |
parents | 5c5d211bd5a8 |
children | fb7cf38a1c7a |
rev | line source |
---|---|
9867
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for mappings and abbreviations |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
15659
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
3 source shared.vim |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
4 |
9867
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 func Test_abbreviation() |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 " abbreviation with 0x80 should work |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 inoreab чкпр vim |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 call feedkeys("Goчкпр \<Esc>", "xt") |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 call assert_equal('vim ', getline('$')) |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 iunab чкпр |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 set nomodified |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 endfunc |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 func Test_map_ctrl_c_insert() |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 " mapping of ctrl-c in Insert mode |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 set cpo-=< cpo-=k |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 inoremap <c-c> <ctrl-c> |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 cnoremap <c-c> dummy |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 cunmap <c-c> |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 call feedkeys("GoTEST2: CTRL-C |\<C-C>A|\<Esc>", "xt") |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 call assert_equal('TEST2: CTRL-C |<ctrl-c>A|', getline('$')) |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 unmap! <c-c> |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 set nomodified |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 endfunc |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 func Test_map_ctrl_c_visual() |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 " mapping of ctrl-c in Visual mode |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 vnoremap <c-c> :<C-u>$put ='vmap works' |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 call feedkeys("GV\<C-C>\<CR>", "xt") |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 call assert_equal('vmap works', getline('$')) |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 vunmap <c-c> |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 set nomodified |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 endfunc |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 func Test_map_langmap() |
9925
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
36 if !has('langmap') |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
37 return |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
38 endif |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
39 |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
40 " check langmap applies in normal mode |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
41 set langmap=+- nolangremap |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
42 new |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
43 call setline(1, ['a', 'b', 'c']) |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
44 2 |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
45 call assert_equal('b', getline('.')) |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
46 call feedkeys("+", "xt") |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
47 call assert_equal('a', getline('.')) |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
48 |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
49 " check no remapping |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
50 map x + |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
51 2 |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
52 call feedkeys("x", "xt") |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
53 call assert_equal('c', getline('.')) |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
54 |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
55 " check with remapping |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
56 set langremap |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
57 2 |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
58 call feedkeys("x", "xt") |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
59 call assert_equal('a', getline('.')) |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
60 |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
61 unmap x |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
62 bwipe! |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
63 |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
64 " 'langnoremap' follows 'langremap' and vise versa |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
65 set langremap |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
66 set langnoremap |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
67 call assert_equal(0, &langremap) |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
68 set langremap |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
69 call assert_equal(0, &langnoremap) |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
70 set nolangremap |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
71 call assert_equal(1, &langnoremap) |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
72 |
10070
09c7df6f8dd3
commit https://github.com/vim/vim/commit/da9ce2cde11ddd0e16cdfbab6d4ac4e8110218e1
Christian Brabandt <cb@256bit.org>
parents:
9925
diff
changeset
|
73 " check default values |
09c7df6f8dd3
commit https://github.com/vim/vim/commit/da9ce2cde11ddd0e16cdfbab6d4ac4e8110218e1
Christian Brabandt <cb@256bit.org>
parents:
9925
diff
changeset
|
74 set langnoremap& |
09c7df6f8dd3
commit https://github.com/vim/vim/commit/da9ce2cde11ddd0e16cdfbab6d4ac4e8110218e1
Christian Brabandt <cb@256bit.org>
parents:
9925
diff
changeset
|
75 call assert_equal(0, &langnoremap) |
09c7df6f8dd3
commit https://github.com/vim/vim/commit/da9ce2cde11ddd0e16cdfbab6d4ac4e8110218e1
Christian Brabandt <cb@256bit.org>
parents:
9925
diff
changeset
|
76 call assert_equal(1, &langremap) |
09c7df6f8dd3
commit https://github.com/vim/vim/commit/da9ce2cde11ddd0e16cdfbab6d4ac4e8110218e1
Christian Brabandt <cb@256bit.org>
parents:
9925
diff
changeset
|
77 set langremap& |
09c7df6f8dd3
commit https://github.com/vim/vim/commit/da9ce2cde11ddd0e16cdfbab6d4ac4e8110218e1
Christian Brabandt <cb@256bit.org>
parents:
9925
diff
changeset
|
78 call assert_equal(0, &langnoremap) |
09c7df6f8dd3
commit https://github.com/vim/vim/commit/da9ce2cde11ddd0e16cdfbab6d4ac4e8110218e1
Christian Brabandt <cb@256bit.org>
parents:
9925
diff
changeset
|
79 call assert_equal(1, &langremap) |
09c7df6f8dd3
commit https://github.com/vim/vim/commit/da9ce2cde11ddd0e16cdfbab6d4ac4e8110218e1
Christian Brabandt <cb@256bit.org>
parents:
9925
diff
changeset
|
80 |
9925
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
81 " langmap should not apply in insert mode, 'langremap' doesn't matter |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
82 set langmap=+{ nolangremap |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
83 call feedkeys("Go+\<Esc>", "xt") |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
84 call assert_equal('+', getline('$')) |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
85 set langmap=+{ langremap |
9867
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
86 call feedkeys("Go+\<Esc>", "xt") |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
87 call assert_equal('+', getline('$')) |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
88 |
9925
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
89 " langmap used for register name in insert mode. |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
90 call setreg('a', 'aaaa') |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
91 call setreg('b', 'bbbb') |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
92 call setreg('c', 'cccc') |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
93 set langmap=ab langremap |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
94 call feedkeys("Go\<C-R>a\<Esc>", "xt") |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
95 call assert_equal('bbbb', getline('$')) |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
96 call feedkeys("Go\<C-R>\<C-R>a\<Esc>", "xt") |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
97 call assert_equal('bbbb', getline('$')) |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
98 " mapping does not apply |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
99 imap c a |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
100 call feedkeys("Go\<C-R>c\<Esc>", "xt") |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
101 call assert_equal('cccc', getline('$')) |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
102 imap a c |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
103 call feedkeys("Go\<C-R>a\<Esc>", "xt") |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
104 call assert_equal('bbbb', getline('$')) |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
105 |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
106 " langmap should not apply in Command-line mode |
3fba3e8326a7
commit https://github.com/vim/vim/commit/920694c1b60fac8017b8909efcc24f189804a9bb
Christian Brabandt <cb@256bit.org>
parents:
9869
diff
changeset
|
107 set langmap=+{ nolangremap |
9867
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
108 call feedkeys(":call append(line('$'), '+')\<CR>", "xt") |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
109 call assert_equal('+', getline('$')) |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
110 |
10787
09926123316b
patch 8.0.0283: mode() does not indicate Insert mode completion
Christian Brabandt <cb@256bit.org>
parents:
10070
diff
changeset
|
111 iunmap a |
09926123316b
patch 8.0.0283: mode() does not indicate Insert mode completion
Christian Brabandt <cb@256bit.org>
parents:
10070
diff
changeset
|
112 iunmap c |
9867
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
113 set nomodified |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
114 endfunc |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
115 |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
116 func Test_map_feedkeys() |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
117 " issue #212 (feedkeys insert mapping at current position) |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
118 nnoremap . :call feedkeys(".", "in")<cr> |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
119 call setline('$', ['a b c d', 'a b c d']) |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
120 $-1 |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
121 call feedkeys("0qqdw.ifoo\<Esc>qj0@q\<Esc>", "xt") |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
122 call assert_equal(['fooc d', 'fooc d'], getline(line('$') - 1, line('$'))) |
10787
09926123316b
patch 8.0.0283: mode() does not indicate Insert mode completion
Christian Brabandt <cb@256bit.org>
parents:
10070
diff
changeset
|
123 nunmap . |
9867
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
124 set nomodified |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
125 endfunc |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
126 |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
127 func Test_map_cursor() |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
128 " <c-g>U<cursor> works only within a single line |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
129 imapclear |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
130 imap ( ()<c-g>U<left> |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
131 call feedkeys("G2o\<Esc>ki\<CR>Test1: text with a (here some more text\<Esc>k.", "xt") |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
132 call assert_equal('Test1: text with a (here some more text)', getline(line('$') - 2)) |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
133 call assert_equal('Test1: text with a (here some more text)', getline(line('$') - 1)) |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
134 |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
135 " test undo |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
136 call feedkeys("G2o\<Esc>ki\<CR>Test2: text wit a (here some more text [und undo]\<C-G>u\<Esc>k.u", "xt") |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
137 call assert_equal('', getline(line('$') - 2)) |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
138 call assert_equal('Test2: text wit a (here some more text [und undo])', getline(line('$') - 1)) |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
139 set nomodified |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
140 imapclear |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
141 endfunc |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
142 |
16101
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
143 func Test_map_cursor_ctrl_gU() |
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
144 " <c-g>U<cursor> works only within a single line |
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
145 nnoremap c<* *Ncgn<C-r>"<C-G>U<S-Left> |
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
146 call setline(1, ['foo', 'foobar', '', 'foo']) |
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
147 call cursor(1,2) |
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
148 call feedkeys("c<*PREFIX\<esc>.", 'xt') |
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
149 call assert_equal(['PREFIXfoo', 'foobar', '', 'PREFIXfoo'], getline(1,'$')) |
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
150 " break undo manually |
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
151 set ul=1000 |
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
152 exe ":norm! uu" |
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
153 call assert_equal(['foo', 'foobar', '', 'foo'], getline(1,'$')) |
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
154 |
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
155 " Test that it does not work if the cursor moves to the previous line |
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
156 " 2 times <S-Left> move to the previous line |
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
157 nnoremap c<* *Ncgn<C-r>"<C-G>U<S-Left><C-G>U<S-Left> |
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
158 call setline(1, ['', ' foo', 'foobar', '', 'foo']) |
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
159 call cursor(2,3) |
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
160 call feedkeys("c<*PREFIX\<esc>.", 'xt') |
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
161 call assert_equal(['PREFIXPREFIX', ' foo', 'foobar', '', 'foo'], getline(1,'$')) |
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
162 nmapclear |
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
163 endfunc |
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
164 |
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
165 |
9867
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
166 " This isn't actually testing a mapping, but similar use of CTRL-G U as above. |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
167 func Test_break_undo() |
16101
5c5d211bd5a8
patch 8.1.1055: CTRL-G U in Insert mode doesn't work for shift-Left
Bram Moolenaar <Bram@vim.org>
parents:
15687
diff
changeset
|
168 set whichwrap=<,>,[,] |
9867
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
169 call feedkeys("G4o2k", "xt") |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
170 exe ":norm! iTest3: text with a (parenthesis here\<C-G>U\<Right>new line here\<esc>\<up>\<up>." |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
171 call assert_equal('new line here', getline(line('$') - 3)) |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
172 call assert_equal('Test3: text with a (parenthesis here', getline(line('$') - 2)) |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
173 call assert_equal('new line here', getline(line('$') - 1)) |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
174 set nomodified |
86f73f026a9a
commit https://github.com/vim/vim/commit/2d1a248762f069e470acde389ff4686a45d2f817
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
175 endfunc |
9869
989d44d35a66
commit https://github.com/vim/vim/commit/35a4cfa200917dd171b1fff3cd5b6cee9add673d
Christian Brabandt <cb@256bit.org>
parents:
9867
diff
changeset
|
176 |
989d44d35a66
commit https://github.com/vim/vim/commit/35a4cfa200917dd171b1fff3cd5b6cee9add673d
Christian Brabandt <cb@256bit.org>
parents:
9867
diff
changeset
|
177 func Test_map_meta_quotes() |
989d44d35a66
commit https://github.com/vim/vim/commit/35a4cfa200917dd171b1fff3cd5b6cee9add673d
Christian Brabandt <cb@256bit.org>
parents:
9867
diff
changeset
|
178 imap <M-"> foo |
989d44d35a66
commit https://github.com/vim/vim/commit/35a4cfa200917dd171b1fff3cd5b6cee9add673d
Christian Brabandt <cb@256bit.org>
parents:
9867
diff
changeset
|
179 call feedkeys("Go-\<M-\">-\<Esc>", "xt") |
989d44d35a66
commit https://github.com/vim/vim/commit/35a4cfa200917dd171b1fff3cd5b6cee9add673d
Christian Brabandt <cb@256bit.org>
parents:
9867
diff
changeset
|
180 call assert_equal("-foo-", getline('$')) |
989d44d35a66
commit https://github.com/vim/vim/commit/35a4cfa200917dd171b1fff3cd5b6cee9add673d
Christian Brabandt <cb@256bit.org>
parents:
9867
diff
changeset
|
181 set nomodified |
989d44d35a66
commit https://github.com/vim/vim/commit/35a4cfa200917dd171b1fff3cd5b6cee9add673d
Christian Brabandt <cb@256bit.org>
parents:
9867
diff
changeset
|
182 iunmap <M-"> |
989d44d35a66
commit https://github.com/vim/vim/commit/35a4cfa200917dd171b1fff3cd5b6cee9add673d
Christian Brabandt <cb@256bit.org>
parents:
9867
diff
changeset
|
183 endfunc |
11295
d772bf077b3f
patch 8.0.0533: abbreviation doesn't work after backspacing newline
Christian Brabandt <cb@256bit.org>
parents:
10787
diff
changeset
|
184 |
d772bf077b3f
patch 8.0.0533: abbreviation doesn't work after backspacing newline
Christian Brabandt <cb@256bit.org>
parents:
10787
diff
changeset
|
185 func Test_abbr_after_line_join() |
d772bf077b3f
patch 8.0.0533: abbreviation doesn't work after backspacing newline
Christian Brabandt <cb@256bit.org>
parents:
10787
diff
changeset
|
186 new |
d772bf077b3f
patch 8.0.0533: abbreviation doesn't work after backspacing newline
Christian Brabandt <cb@256bit.org>
parents:
10787
diff
changeset
|
187 abbr foo bar |
d772bf077b3f
patch 8.0.0533: abbreviation doesn't work after backspacing newline
Christian Brabandt <cb@256bit.org>
parents:
10787
diff
changeset
|
188 set backspace=indent,eol,start |
d772bf077b3f
patch 8.0.0533: abbreviation doesn't work after backspacing newline
Christian Brabandt <cb@256bit.org>
parents:
10787
diff
changeset
|
189 exe "normal o\<BS>foo " |
d772bf077b3f
patch 8.0.0533: abbreviation doesn't work after backspacing newline
Christian Brabandt <cb@256bit.org>
parents:
10787
diff
changeset
|
190 call assert_equal("bar ", getline(1)) |
d772bf077b3f
patch 8.0.0533: abbreviation doesn't work after backspacing newline
Christian Brabandt <cb@256bit.org>
parents:
10787
diff
changeset
|
191 bwipe! |
d772bf077b3f
patch 8.0.0533: abbreviation doesn't work after backspacing newline
Christian Brabandt <cb@256bit.org>
parents:
10787
diff
changeset
|
192 unabbr foo |
d772bf077b3f
patch 8.0.0533: abbreviation doesn't work after backspacing newline
Christian Brabandt <cb@256bit.org>
parents:
10787
diff
changeset
|
193 set backspace& |
d772bf077b3f
patch 8.0.0533: abbreviation doesn't work after backspacing newline
Christian Brabandt <cb@256bit.org>
parents:
10787
diff
changeset
|
194 endfunc |
11403
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
195 |
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
196 func Test_map_timeout() |
15659
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
197 if !has('timers') |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
198 return |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
199 endif |
11403
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
200 nnoremap aaaa :let got_aaaa = 1<CR> |
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
201 nnoremap bb :let got_bb = 1<CR> |
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
202 nmap b aaa |
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
203 new |
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
204 func ExitInsert(timer) |
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
205 let g:line = getline(1) |
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
206 call feedkeys("\<Esc>", "t") |
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
207 endfunc |
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
208 set timeout timeoutlen=200 |
15659
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
209 let timer = timer_start(300, 'ExitInsert') |
11403
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
210 " After the 'b' Vim waits for another character to see if it matches 'bb'. |
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
211 " When it times out it is expanded to "aaa", but there is no wait for |
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
212 " "aaaa". Can't check that reliably though. |
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
213 call feedkeys("b", "xt!") |
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
214 call assert_equal("aa", g:line) |
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
215 call assert_false(exists('got_aaa')) |
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
216 call assert_false(exists('got_bb')) |
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
217 |
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
218 bwipe! |
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
219 nunmap aaaa |
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
220 nunmap bb |
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
221 nunmap b |
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
222 set timeoutlen& |
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
223 delfunc ExitInsert |
15659
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
224 call timer_stop(timer) |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
225 endfunc |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
226 |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
227 func Test_map_timeout_with_timer_interrupt() |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
228 if !has('job') || !has('timers') |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
229 return |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
230 endif |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
231 |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
232 " Confirm the timer invoked in exit_cb of the job doesn't disturb mapped key |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
233 " sequence. |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
234 new |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
235 let g:val = 0 |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
236 nnoremap \12 :let g:val = 1<CR> |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
237 nnoremap \123 :let g:val = 2<CR> |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
238 set timeout timeoutlen=1000 |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
239 |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
240 func ExitCb(job, status) |
15687
cb501b3c9fb5
patch 8.1.0851: feedkeys() with "L" does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
15659
diff
changeset
|
241 let g:timer = timer_start(1, {-> feedkeys("3\<Esc>", 't')}) |
15659
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
242 endfunc |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
243 |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
244 call job_start([&shell, &shellcmdflag, 'echo'], {'exit_cb': 'ExitCb'}) |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
245 call feedkeys('\12', 'xt!') |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
246 call assert_equal(2, g:val) |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
247 |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
248 bwipe! |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
249 nunmap \12 |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
250 nunmap \123 |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
251 set timeoutlen& |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
252 call WaitFor({-> exists('g:timer')}) |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
253 call timer_stop(g:timer) |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
254 unlet g:timer |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
255 unlet g:val |
8513d9864f7e
patch 8.1.0837: timer interrupting cursorhold and mapping not tested
Bram Moolenaar <Bram@vim.org>
parents:
15607
diff
changeset
|
256 delfunc ExitCb |
11403
74a40efb39ea
patch 8.0.0586: no test for mapping timing out
Christian Brabandt <cb@256bit.org>
parents:
11295
diff
changeset
|
257 endfunc |
13788
a27d380b257f
patch 8.0.1766: expanding abbreviation doesn't work
Christian Brabandt <cb@256bit.org>
parents:
11403
diff
changeset
|
258 |
a27d380b257f
patch 8.0.1766: expanding abbreviation doesn't work
Christian Brabandt <cb@256bit.org>
parents:
11403
diff
changeset
|
259 func Test_abbreviation_CR() |
a27d380b257f
patch 8.0.1766: expanding abbreviation doesn't work
Christian Brabandt <cb@256bit.org>
parents:
11403
diff
changeset
|
260 new |
a27d380b257f
patch 8.0.1766: expanding abbreviation doesn't work
Christian Brabandt <cb@256bit.org>
parents:
11403
diff
changeset
|
261 func Eatchar(pat) |
a27d380b257f
patch 8.0.1766: expanding abbreviation doesn't work
Christian Brabandt <cb@256bit.org>
parents:
11403
diff
changeset
|
262 let c = nr2char(getchar(0)) |
a27d380b257f
patch 8.0.1766: expanding abbreviation doesn't work
Christian Brabandt <cb@256bit.org>
parents:
11403
diff
changeset
|
263 return (c =~ a:pat) ? '' : c |
a27d380b257f
patch 8.0.1766: expanding abbreviation doesn't work
Christian Brabandt <cb@256bit.org>
parents:
11403
diff
changeset
|
264 endfunc |
a27d380b257f
patch 8.0.1766: expanding abbreviation doesn't work
Christian Brabandt <cb@256bit.org>
parents:
11403
diff
changeset
|
265 iabbrev <buffer><silent> ~~7 <c-r>=repeat('~', 7)<CR><c-r>=Eatchar('\s')<cr> |
a27d380b257f
patch 8.0.1766: expanding abbreviation doesn't work
Christian Brabandt <cb@256bit.org>
parents:
11403
diff
changeset
|
266 call feedkeys("GA~~7 \<esc>", 'xt') |
a27d380b257f
patch 8.0.1766: expanding abbreviation doesn't work
Christian Brabandt <cb@256bit.org>
parents:
11403
diff
changeset
|
267 call assert_equal('~~~~~~~', getline('$')) |
a27d380b257f
patch 8.0.1766: expanding abbreviation doesn't work
Christian Brabandt <cb@256bit.org>
parents:
11403
diff
changeset
|
268 %d |
a27d380b257f
patch 8.0.1766: expanding abbreviation doesn't work
Christian Brabandt <cb@256bit.org>
parents:
11403
diff
changeset
|
269 call feedkeys("GA~~7\<cr>\<esc>", 'xt') |
a27d380b257f
patch 8.0.1766: expanding abbreviation doesn't work
Christian Brabandt <cb@256bit.org>
parents:
11403
diff
changeset
|
270 call assert_equal(['~~~~~~~', ''], getline(1,'$')) |
a27d380b257f
patch 8.0.1766: expanding abbreviation doesn't work
Christian Brabandt <cb@256bit.org>
parents:
11403
diff
changeset
|
271 delfunc Eatchar |
a27d380b257f
patch 8.0.1766: expanding abbreviation doesn't work
Christian Brabandt <cb@256bit.org>
parents:
11403
diff
changeset
|
272 bw! |
a27d380b257f
patch 8.0.1766: expanding abbreviation doesn't work
Christian Brabandt <cb@256bit.org>
parents:
11403
diff
changeset
|
273 endfunc |
13933
bea665293ea0
patch 8.0.1837: one character cmdline abbreviation not triggered after '<,'>
Christian Brabandt <cb@256bit.org>
parents:
13788
diff
changeset
|
274 |
bea665293ea0
patch 8.0.1837: one character cmdline abbreviation not triggered after '<,'>
Christian Brabandt <cb@256bit.org>
parents:
13788
diff
changeset
|
275 func Test_cabbr_visual_mode() |
bea665293ea0
patch 8.0.1837: one character cmdline abbreviation not triggered after '<,'>
Christian Brabandt <cb@256bit.org>
parents:
13788
diff
changeset
|
276 cabbr s su |
bea665293ea0
patch 8.0.1837: one character cmdline abbreviation not triggered after '<,'>
Christian Brabandt <cb@256bit.org>
parents:
13788
diff
changeset
|
277 call feedkeys(":s \<c-B>\"\<CR>", 'itx') |
bea665293ea0
patch 8.0.1837: one character cmdline abbreviation not triggered after '<,'>
Christian Brabandt <cb@256bit.org>
parents:
13788
diff
changeset
|
278 call assert_equal('"su ', getreg(':')) |
bea665293ea0
patch 8.0.1837: one character cmdline abbreviation not triggered after '<,'>
Christian Brabandt <cb@256bit.org>
parents:
13788
diff
changeset
|
279 call feedkeys(":'<,'>s \<c-B>\"\<CR>", 'itx') |
bea665293ea0
patch 8.0.1837: one character cmdline abbreviation not triggered after '<,'>
Christian Brabandt <cb@256bit.org>
parents:
13788
diff
changeset
|
280 let expected = '"'. "'<,'>su " |
bea665293ea0
patch 8.0.1837: one character cmdline abbreviation not triggered after '<,'>
Christian Brabandt <cb@256bit.org>
parents:
13788
diff
changeset
|
281 call assert_equal(expected, getreg(':')) |
bea665293ea0
patch 8.0.1837: one character cmdline abbreviation not triggered after '<,'>
Christian Brabandt <cb@256bit.org>
parents:
13788
diff
changeset
|
282 call feedkeys(": '<,'>s \<c-B>\"\<CR>", 'itx') |
bea665293ea0
patch 8.0.1837: one character cmdline abbreviation not triggered after '<,'>
Christian Brabandt <cb@256bit.org>
parents:
13788
diff
changeset
|
283 let expected = '" '. "'<,'>su " |
bea665293ea0
patch 8.0.1837: one character cmdline abbreviation not triggered after '<,'>
Christian Brabandt <cb@256bit.org>
parents:
13788
diff
changeset
|
284 call assert_equal(expected, getreg(':')) |
bea665293ea0
patch 8.0.1837: one character cmdline abbreviation not triggered after '<,'>
Christian Brabandt <cb@256bit.org>
parents:
13788
diff
changeset
|
285 call feedkeys(":'a,'bs \<c-B>\"\<CR>", 'itx') |
bea665293ea0
patch 8.0.1837: one character cmdline abbreviation not triggered after '<,'>
Christian Brabandt <cb@256bit.org>
parents:
13788
diff
changeset
|
286 let expected = '"'. "'a,'bsu " |
bea665293ea0
patch 8.0.1837: one character cmdline abbreviation not triggered after '<,'>
Christian Brabandt <cb@256bit.org>
parents:
13788
diff
changeset
|
287 call assert_equal(expected, getreg(':')) |
bea665293ea0
patch 8.0.1837: one character cmdline abbreviation not triggered after '<,'>
Christian Brabandt <cb@256bit.org>
parents:
13788
diff
changeset
|
288 cunabbr s |
bea665293ea0
patch 8.0.1837: one character cmdline abbreviation not triggered after '<,'>
Christian Brabandt <cb@256bit.org>
parents:
13788
diff
changeset
|
289 endfunc |
15279
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
290 |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
291 func Test_motionforce_omap() |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
292 func GetCommand() |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
293 let g:m=mode(1) |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
294 let [g:lnum1, g:col1] = searchpos('-', 'Wb') |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
295 if g:lnum1 == 0 |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
296 return "\<Esc>" |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
297 endif |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
298 let [g:lnum2, g:col2] = searchpos('-', 'W') |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
299 if g:lnum2 == 0 |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
300 return "\<Esc>" |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
301 endif |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
302 return ":call Select()\<CR>" |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
303 endfunc |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
304 func Select() |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
305 call cursor([g:lnum1, g:col1]) |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
306 exe "normal! 1 ". (strlen(g:m) == 2 ? 'v' : g:m[2]) |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
307 call cursor([g:lnum2, g:col2]) |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
308 execute "normal! \<BS>" |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
309 endfunc |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
310 new |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
311 onoremap <buffer><expr> i- GetCommand() |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
312 " 1) default omap mapping |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
313 %d_ |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
314 call setline(1, ['aaa - bbb', 'x', 'ddd - eee']) |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
315 call cursor(2, 1) |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
316 norm di- |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
317 call assert_equal('no', g:m) |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
318 call assert_equal(['aaa -- eee'], getline(1, '$')) |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
319 " 2) forced characterwise operation |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
320 %d_ |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
321 call setline(1, ['aaa - bbb', 'x', 'ddd - eee']) |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
322 call cursor(2, 1) |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
323 norm dvi- |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
324 call assert_equal('nov', g:m) |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
325 call assert_equal(['aaa -- eee'], getline(1, '$')) |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
326 " 3) forced linewise operation |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
327 %d_ |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
328 call setline(1, ['aaa - bbb', 'x', 'ddd - eee']) |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
329 call cursor(2, 1) |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
330 norm dVi- |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
331 call assert_equal('noV', g:m) |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
332 call assert_equal([''], getline(1, '$')) |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
333 " 4) forced blockwise operation |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
334 %d_ |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
335 call setline(1, ['aaa - bbb', 'x', 'ddd - eee']) |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
336 call cursor(2, 1) |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
337 exe "norm d\<C-V>i-" |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
338 call assert_equal("no\<C-V>", g:m) |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
339 call assert_equal(['aaabbb', 'x', 'dddeee'], getline(1, '$')) |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
340 bwipe! |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
341 delfunc Select |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
342 delfunc GetCommand |
54457fc4af0b
patch 8.1.0648: custom operators can't act upon a forced motion
Bram Moolenaar <Bram@vim.org>
parents:
13933
diff
changeset
|
343 endfunc |