diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-01-13 03:27:23 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-01-13 03:27:23 -0500 |
commit | 7f3999ac806daefa078b4db0781bfc1e190e135e (patch) | |
tree | 6386cdb6bf191873fc6ea1593a713e145810165a /test/functional/legacy | |
parent | 5c87d40acdd02286baf492067031c93d93b7d389 (diff) | |
parent | 8eeda7169aa47881f0b6d697e291a1ef85c43e4e (diff) | |
download | rneovim-7f3999ac806daefa078b4db0781bfc1e190e135e.tar.gz rneovim-7f3999ac806daefa078b4db0781bfc1e190e135e.tar.bz2 rneovim-7f3999ac806daefa078b4db0781bfc1e190e135e.zip |
Merge pull request #3996 from justinmk/ctrlc
vim-patch:7.4.569, 7.4.573
Diffstat (limited to 'test/functional/legacy')
-rw-r--r-- | test/functional/legacy/mapping_spec.lua | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/test/functional/legacy/mapping_spec.lua b/test/functional/legacy/mapping_spec.lua index 4d377904f9..3f86ec60de 100644 --- a/test/functional/legacy/mapping_spec.lua +++ b/test/functional/legacy/mapping_spec.lua @@ -2,12 +2,12 @@ local helpers = require('test.functional.helpers') local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert -local execute, expect = helpers.execute, helpers.expect +local execute, expect, wait = helpers.execute, helpers.expect, helpers.wait describe('mapping', function() before_each(clear) - it('is working', function() + it('abbreviations with р (0x80)', function() insert([[ test starts here: ]]) @@ -16,6 +16,46 @@ describe('mapping', function() execute('inoreab чкпр vim') feed('GAчкпр <esc>') + expect([[ + test starts here: + vim ]]) + end) + + it('Ctrl-c works in Insert mode', function() + -- Mapping of ctrl-c in insert mode + execute('set cpo-=< cpo-=k') + execute('inoremap <c-c> <ctrl-c>') + execute('cnoremap <c-c> dummy') + execute('cunmap <c-c>') + feed('GA<cr>') + feed('TEST2: CTRL-C |') + wait() + feed('<c-c>A|<cr><esc>') + wait() + execute('unmap <c-c>') + execute('unmap! <c-c>') + + expect([[ + + TEST2: CTRL-C |<ctrl-c>A| + ]]) + end) + + it('Ctrl-c works in Visual mode', function() + execute([[vnoremap <c-c> :<C-u>$put ='vmap works'<cr>]]) + feed('GV') + -- XXX: For some reason the mapping is only triggered + -- when <C-c> is in a separate feed command. + wait() + feed('<c-c>') + execute('vunmap <c-c>') + + expect([[ + + vmap works]]) + end) + + it('langmap', function() -- langmap should not get remapped in insert mode. execute('inoremap { FAIL_ilangmap') execute('set langmap=+{ langnoremap') @@ -37,8 +77,7 @@ describe('mapping', function() -- Assert buffer contents. expect([[ - test starts here: - vim + + + + |