From 0f9dea2a0e344ded3bd4f8664acfed4fd3381c8e Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 7 Sep 2015 22:27:21 -0400 Subject: 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 --- test/functional/legacy/mapping_spec.lua | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'test') 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() + -- U works only within a single line + execute('imapclear') + execute('imap ( ()U') + feed('G2okiTest1: text with a (here some more textk.') + -- test undo + feed('G2okiTest2: text wit a (here some more text [und undo]uk.u') + execute('imapclear') + execute('set whichwrap=<,>,[,]') + feed('G3o2k') + execute([[:exe ":norm! iTest3: text with a (parenthesis here\U\new line here\\\."]]) + + 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) -- cgit