blob: 4b260f8480120d897cc3ed42c699c7fbec8f9a48 [file] [log] [blame]
Bram Moolenaar25281632016-01-21 23:32:32 +01001" tests for 'langmap'
2
Bram Moolenaar09e786e2016-01-21 23:53:06 +01003if !has('langmap')
Bram Moolenaarb0f94c12019-06-13 22:19:53 +02004 throw 'Skipped, langmap feature missing'
Bram Moolenaar09e786e2016-01-21 23:53:06 +01005endif
6
Bram Moolenaar25281632016-01-21 23:32:32 +01007func Test_langmap()
8 new
9 set langmap=}l,^x,%v
10
11 call setline(1, ['abc'])
12 call feedkeys('gg0}^', 'tx')
13 call assert_equal('ac', getline(1))
14
15 " in Replace mode
16 " need silent! to avoid a delay when entering Insert mode
17 call setline(1, ['abcde'])
18 silent! call feedkeys("gg0lR%{z\<Esc>00", 'tx')
19 call assert_equal('a%{ze', getline(1))
20
21 " in Select mode
22 " need silent! to avoid a delay when entering Insert mode
23 call setline(1, ['abcde'])
24 silent! call feedkeys("gg0}%}\<C-G>}^\<Esc>00", 'tx')
25 call assert_equal('a}^de', getline(1))
26
27 quit!
28endfunc