blob: 420ff0fe8a4b1bb1c7065218e48c597b65e6a4c3 [file] [log] [blame]
Bram Moolenaar25281632016-01-21 23:32:32 +01001" tests for 'langmap'
2
Bram Moolenaarb46fecd2019-06-15 17:58:09 +02003source check.vim
4CheckFeature langmap
Bram Moolenaar09e786e2016-01-21 23:53:06 +01005
Bram Moolenaar25281632016-01-21 23:32:32 +01006func Test_langmap()
7 new
8 set langmap=}l,^x,%v
9
10 call setline(1, ['abc'])
11 call feedkeys('gg0}^', 'tx')
12 call assert_equal('ac', getline(1))
13
14 " in Replace mode
15 " need silent! to avoid a delay when entering Insert mode
16 call setline(1, ['abcde'])
17 silent! call feedkeys("gg0lR%{z\<Esc>00", 'tx')
18 call assert_equal('a%{ze', getline(1))
19
20 " in Select mode
21 " need silent! to avoid a delay when entering Insert mode
22 call setline(1, ['abcde'])
23 silent! call feedkeys("gg0}%}\<C-G>}^\<Esc>00", 'tx')
24 call assert_equal('a}^de', getline(1))
25
26 quit!
27endfunc