From e13b4a21cac9d173885249034fe20fb209b157df Mon Sep 17 00:00:00 2001 From: KunMing Xie Date: Tue, 8 Aug 2017 09:32:47 +0800 Subject: 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 --- src/nvim/testdir/test_undo.vim | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/nvim/testdir/test_undo.vim') 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\", 'xt') + set ul=100 + call test_settime(t0 + 1) + call feedkeys("otwo\", 'xt') + set ul=100 + call test_settime(t0 + 2) + call feedkeys("othree\", '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 -- cgit