diff options
author | James McCoy <jamessan@jamessan.com> | 2017-02-02 12:45:02 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-02 12:45:02 -0500 |
commit | e8899178ec34e8432fc2e63f2970b0962e72c74c (patch) | |
tree | c8b464c7b7aa3f7026decae1c37f8cd379325e77 /test | |
parent | 05081927744f1942dbe49b17dd58e7c3d5f57916 (diff) | |
parent | e0e4825897cdfcd2d125240321ec2980a40f7951 (diff) | |
download | rneovim-e8899178ec34e8432fc2e63f2970b0962e72c74c.tar.gz rneovim-e8899178ec34e8432fc2e63f2970b0962e72c74c.tar.bz2 rneovim-e8899178ec34e8432fc2e63f2970b0962e72c74c.zip |
Merge pull request #5869 from hardenedapple/undojoin-curhead
Don't set `b_u_curhead` in `ex_undojoin()`
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/ex_cmds/undojoin_spec.lua | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/functional/ex_cmds/undojoin_spec.lua b/test/functional/ex_cmds/undojoin_spec.lua new file mode 100644 index 0000000000..ba1e46ceb3 --- /dev/null +++ b/test/functional/ex_cmds/undojoin_spec.lua @@ -0,0 +1,38 @@ +local helpers = require('test.functional.helpers')(after_each) + +local eq = helpers.eq +local clear = helpers.clear +local insert = helpers.insert +local feed = helpers.feed +local expect = helpers.expect +local execute = helpers.execute +local exc_exec = helpers.exc_exec + +describe(':undojoin command', function() + before_each(function() + clear() + insert([[ + Line of text 1 + Line of text 2]]) + execute('goto 1') + end) + it('joins changes in a buffer', function() + execute('undojoin | delete') + expect([[ + Line of text 2]]) + feed('u') + expect([[ + ]]) + end) + it('does not corrupt undolist when connected with redo', function() + feed('ixx<esc>') + execute('undojoin | redo') + expect([[ + xxLine of text 1 + Line of text 2]]) + end) + it('does not raise an error when called twice', function() + local ret = exc_exec('undojoin | undojoin') + eq(0, ret) + end) +end) |