aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorKunMing Xie <qqzz014@gmail.com>2017-08-08 09:32:47 +0800
committerJustin M. Keyes <justinkz@gmail.com>2017-08-08 03:32:47 +0200
commite13b4a21cac9d173885249034fe20fb209b157df (patch)
tree058839fa07d78d6b26ec605421b67e521272ab23 /src/nvim/testdir
parent2753d61e4cb037323d78ed3fd978a10694c902c6 (diff)
downloadrneovim-e13b4a21cac9d173885249034fe20fb209b157df.tar.gz
rneovim-e13b4a21cac9d173885249034fe20fb209b157df.tar.bz2
rneovim-e13b4a21cac9d173885249034fe20fb209b157df.zip
vim-patch:8.0.0149 (#7127)
Problem: ":earlier" and ":later" do not work after startup or reading the undo file. Solution: Use absolute time stamps instead of relative to the Vim start time. (Christian Brabandt, Pavel Juhas, closes vim/vim#1300, closes vim/vim#1254) https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_undo.vim28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_undo.vim b/src/nvim/testdir/test_undo.vim
index 9ff73fd870..171618f6f7 100644
--- a/src/nvim/testdir/test_undo.vim
+++ b/src/nvim/testdir/test_undo.vim
@@ -237,3 +237,31 @@ func Test_insert_expr()
close!
endfunc
+
+func Test_undofile_earlier()
+ throw 'skipped: Nvim does not support test_settime()'
+
+ let t0 = localtime() - 43200
+ call test_settime(t0)
+ new Xfile
+ call feedkeys("ione\<Esc>", 'xt')
+ set ul=100
+ call test_settime(t0 + 1)
+ call feedkeys("otwo\<Esc>", 'xt')
+ set ul=100
+ call test_settime(t0 + 2)
+ call feedkeys("othree\<Esc>", 'xt')
+ set ul=100
+ w
+ wundo Xundofile
+ bwipe!
+ " restore normal timestamps.
+ call test_settime(0)
+ new Xfile
+ rundo Xundofile
+ earlier 1d
+ call assert_equal('', getline(1))
+ bwipe!
+ call delete('Xfile')
+ call delete('Xundofile')
+endfunc