aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-08-21 09:33:09 +0200
committerGitHub <noreply@github.com>2018-08-21 09:33:09 +0200
commit38075200015e0e47d930a0ac7550546fd4cb2f9e (patch)
tree804f1f8d75dd403f21061f37ffe3bcbd82c48457 /src/nvim/testdir
parent0c9888cdbe800f1945823ec9affa3056b8feeeac (diff)
parentee51061b8c00eb1ac8ce628ba3831236b327ead2 (diff)
downloadrneovim-38075200015e0e47d930a0ac7550546fd4cb2f9e.tar.gz
rneovim-38075200015e0e47d930a0ac7550546fd4cb2f9e.tar.bz2
rneovim-38075200015e0e47d930a0ac7550546fd4cb2f9e.zip
Merge #8877 from janlazo/vim-8.0.1441
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_undo.vim44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_undo.vim b/src/nvim/testdir/test_undo.vim
index f31499607b..83ede1dc37 100644
--- a/src/nvim/testdir/test_undo.vim
+++ b/src/nvim/testdir/test_undo.vim
@@ -390,3 +390,47 @@ funct Test_undofile()
set undodir&
endfunc
+
+func Test_undo_0()
+ new
+ set ul=100
+ normal i1
+ undo
+ normal i2
+ undo
+ normal i3
+
+ undo 0
+ let d = undotree()
+ call assert_equal('', getline(1))
+ call assert_equal(0, d.seq_cur)
+
+ redo
+ let d = undotree()
+ call assert_equal('3', getline(1))
+ call assert_equal(3, d.seq_cur)
+
+ undo 2
+ undo 0
+ let d = undotree()
+ call assert_equal('', getline(1))
+ call assert_equal(0, d.seq_cur)
+
+ redo
+ let d = undotree()
+ call assert_equal('2', getline(1))
+ call assert_equal(2, d.seq_cur)
+
+ undo 1
+ undo 0
+ let d = undotree()
+ call assert_equal('', getline(1))
+ call assert_equal(0, d.seq_cur)
+
+ redo
+ let d = undotree()
+ call assert_equal('1', getline(1))
+ call assert_equal(1, d.seq_cur)
+
+ bwipe!
+endfunc