aboutsummaryrefslogtreecommitdiff
path: root/test/functional/editor/undo_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/editor/undo_spec.lua')
-rw-r--r--test/functional/editor/undo_spec.lua38
1 files changed, 28 insertions, 10 deletions
diff --git a/test/functional/editor/undo_spec.lua b/test/functional/editor/undo_spec.lua
index d66ab352ef..c101bf02a0 100644
--- a/test/functional/editor/undo_spec.lua
+++ b/test/functional/editor/undo_spec.lua
@@ -8,12 +8,12 @@ local eq = helpers.eq
local feed = helpers.feed
local feed_command = helpers.feed_command
local insert = helpers.insert
-local funcs = helpers.funcs
+local fn = helpers.fn
local exec = helpers.exec
local exec_lua = helpers.exec_lua
local function lastmessage()
- local messages = funcs.split(funcs.execute('messages'), '\n')
+ local messages = fn.split(fn.execute('messages'), '\n')
return messages[#messages]
end
@@ -21,15 +21,23 @@ describe('u CTRL-R g- g+', function()
before_each(clear)
local function create_history(num_steps)
- if num_steps == 0 then return end
+ if num_steps == 0 then
+ return
+ end
insert('1')
- if num_steps == 1 then return end
+ if num_steps == 1 then
+ return
+ end
feed('o2<esc>')
feed('o3<esc>')
feed('u')
- if num_steps == 2 then return end
+ if num_steps == 2 then
+ return
+ end
feed('o4<esc>')
- if num_steps == 3 then return end
+ if num_steps == 3 then
+ return
+ end
feed('u')
end
@@ -57,13 +65,23 @@ describe('u CTRL-R g- g+', function()
undo_and_redo(2, 'g-', 'g+', '1')
end)
it('undoes properly around a branch point', function()
- undo_and_redo(3, 'u', '<C-r>', [[
+ undo_and_redo(
+ 3,
+ 'u',
+ '<C-r>',
+ [[
1
- 2]])
- undo_and_redo(3, 'g-', 'g+', [[
+ 2]]
+ )
+ undo_and_redo(
+ 3,
+ 'g-',
+ 'g+',
+ [[
1
2
- 3]])
+ 3]]
+ )
end)
it('can find the previous sequence after undoing to a branch', function()
undo_and_redo(4, 'u', '<C-r>', '1')