Bram Moolenaar | 2528163 | 2016-01-21 23:32:32 +0100 | [diff] [blame] | 1 | " tests for 'langmap' |
| 2 | |
Bram Moolenaar | 09e786e | 2016-01-21 23:53:06 +0100 | [diff] [blame] | 3 | if !has('langmap') |
Bram Moolenaar | b0f94c1 | 2019-06-13 22:19:53 +0200 | [diff] [blame] | 4 | throw 'Skipped, langmap feature missing' |
Bram Moolenaar | 09e786e | 2016-01-21 23:53:06 +0100 | [diff] [blame] | 5 | endif |
| 6 | |
Bram Moolenaar | 2528163 | 2016-01-21 23:32:32 +0100 | [diff] [blame] | 7 | func 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! |
| 28 | endfunc |