aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/mapping_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2015-09-07 22:27:21 -0400
committerJustin M. Keyes <justinkz@gmail.com>2015-10-26 02:23:59 -0400
commit0f9dea2a0e344ded3bd4f8664acfed4fd3381c8e (patch)
tree6a01f4ec62b4ed0f5dd856987b62eefb38f377b4 /test/functional/legacy/mapping_spec.lua
parent1ca5646bb52ec5c23b28f45bb7bc5d25cffad9b0 (diff)
downloadrneovim-0f9dea2a0e344ded3bd4f8664acfed4fd3381c8e.tar.gz
rneovim-0f9dea2a0e344ded3bd4f8664acfed4fd3381c8e.tar.bz2
rneovim-0f9dea2a0e344ded3bd4f8664acfed4fd3381c8e.zip
vim-patch:7.4.849
Problem: Moving the cursor in Insert mode starts new undo sequence. Solution: Add CTRL-G U to keep the undo sequence for the following cursor movement command. (Christian Brabandt) https://github.com/vim/vim/commit/8b5f65a527c353b9942e362e719687c3a7592309 Closes #3492
Diffstat (limited to 'test/functional/legacy/mapping_spec.lua')
-rw-r--r--test/functional/legacy/mapping_spec.lua28
1 files changed, 27 insertions, 1 deletions
diff --git a/test/functional/legacy/mapping_spec.lua b/test/functional/legacy/mapping_spec.lua
index 899f7423d0..4d377904f9 100644
--- a/test/functional/legacy/mapping_spec.lua
+++ b/test/functional/legacy/mapping_spec.lua
@@ -5,7 +5,7 @@ local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local execute, expect = helpers.execute, helpers.expect
describe('mapping', function()
- setup(clear)
+ before_each(clear)
it('is working', function()
insert([[
@@ -44,4 +44,30 @@ describe('mapping', function()
+
+]])
end)
+
+ it('i_CTRL-G_U', function()
+ -- <c-g>U<cursor> works only within a single line
+ execute('imapclear')
+ execute('imap ( ()<c-g>U<left>')
+ feed('G2o<esc>ki<cr>Test1: text with a (here some more text<esc>k.')
+ -- test undo
+ feed('G2o<esc>ki<cr>Test2: text wit a (here some more text [und undo]<c-g>u<esc>k.u')
+ execute('imapclear')
+ execute('set whichwrap=<,>,[,]')
+ feed('G3o<esc>2k')
+ execute([[:exe ":norm! iTest3: text with a (parenthesis here\<C-G>U\<Right>new line here\<esc>\<up>\<up>."]])
+
+ expect([[
+
+
+ Test1: text with a (here some more text)
+ Test1: text with a (here some more text)
+
+
+ Test2: text wit a (here some more text [und undo])
+ new line here
+ Test3: text with a (parenthesis here
+ new line here
+ ]])
+ end)
end)