2014-12-23 04:24:54 -07:00
|
|
|
|
-- Test for mappings and abbreviations
|
|
|
|
|
|
|
|
|
|
local helpers = require('test.functional.helpers')
|
|
|
|
|
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
|
|
|
|
|
local execute, expect = helpers.execute, helpers.expect
|
|
|
|
|
|
|
|
|
|
describe('mapping', function()
|
|
|
|
|
setup(clear)
|
|
|
|
|
|
|
|
|
|
it('is working', function()
|
|
|
|
|
insert([[
|
|
|
|
|
test starts here:
|
|
|
|
|
]])
|
|
|
|
|
|
2014-12-23 05:01:14 -07:00
|
|
|
|
execute('set encoding=utf-8')
|
|
|
|
|
|
2014-12-23 04:24:54 -07:00
|
|
|
|
-- Abbreviations with р (0x80) should work.
|
|
|
|
|
execute('inoreab чкпр vim')
|
|
|
|
|
feed('GAчкпр <cr><esc>')
|
|
|
|
|
|
2014-12-26 08:49:44 -07:00
|
|
|
|
-- langmap should not get remapped in insert mode.
|
|
|
|
|
execute('inoremap { FAIL_ilangmap')
|
|
|
|
|
execute('set langmap=+{ langnoremap')
|
|
|
|
|
feed('o+<esc>')
|
|
|
|
|
|
|
|
|
|
-- expr mapping with langmap.
|
|
|
|
|
execute('inoremap <expr> { "FAIL_iexplangmap"')
|
|
|
|
|
feed('o+<esc>')
|
|
|
|
|
|
2014-12-23 04:24:54 -07:00
|
|
|
|
-- Assert buffer contents.
|
|
|
|
|
expect([[
|
|
|
|
|
test starts here:
|
2014-12-26 08:49:44 -07:00
|
|
|
|
vim
|
|
|
|
|
+
|
|
|
|
|
+]])
|
2014-12-23 04:24:54 -07:00
|
|
|
|
end)
|
|
|
|
|
end)
|