blob: b7f2783f54d4a31341446aeea2c8e99c4ad6b3db [file] [log] [blame]
Bram Moolenaarb69a7142013-11-02 04:19:34 +01001Tests for maparg().
Bram Moolenaar1d9ff432014-03-12 20:17:51 +01002Also test utf8 map with a 0x80 byte.
Bram Moolenaarbd743252010-10-20 21:23:33 +02003
4STARTTEST
5:so small.vim
Bram Moolenaar1d9ff432014-03-12 20:17:51 +01006:so mbyte.vim
Bram Moolenaar792826c2011-08-19 22:29:02 +02007:set cpo-=<
Bram Moolenaar1d9ff432014-03-12 20:17:51 +01008:set encoding=utf8
Bram Moolenaarbd743252010-10-20 21:23:33 +02009:" Test maparg() with a string result
10:map foo<C-V> is<F4>foo
11:vnoremap <script> <buffer> <expr> <silent> bar isbar
12:call append('$', maparg('foo<C-V>'))
13:call append('$', string(maparg('foo<C-V>', '', 0, 1)))
14:call append('$', string(maparg('bar', '', 0, 1)))
Bram Moolenaar72179e12013-06-29 13:58:31 +020015:map <buffer> <nowait> foo bar
16:call append('$', string(maparg('foo', '', 0, 1)))
Bram Moolenaarbd743252010-10-20 21:23:33 +020017:"
Bram Moolenaar792826c2011-08-19 22:29:02 +020018:map abc x<char-114>x
19:call append('$', maparg('abc'))
20:map abc y<S-char-114>y
21:call append('$', maparg('abc'))
22:"
Bram Moolenaar1d9ff432014-03-12 20:17:51 +010023Go:"
24:" Outside of the range, minimum
25:inoremap <Char-0x1040> a
26:call feedkeys("a\u1040\<Esc>")
27:" Inside of the range, minimum
28:inoremap <Char-0x103f> b
29:call feedkeys("a\u103f\<Esc>")
30:" Inside of the range, maximum
31:inoremap <Char-0xf03f> c
32:call feedkeys("a\uf03f\<Esc>")
33:" Outside of the range, maximum
34:inoremap <Char-0xf040> d
35:call feedkeys("a\uf040\<Esc>")
36:"
Bram Moolenaarbd743252010-10-20 21:23:33 +020037:/^eof/+1,$w! test.out
38:qa!
39ENDTEST
40
41eof