summaryrefslogtreecommitdiff
path: root/src/testdir/test_viminfo.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-06-13 22:22:15 +0200
committerBram Moolenaar <Bram@vim.org>2016-06-13 22:22:15 +0200
commitece74ab103eca15e17435efbe9cb21039787f1ea (patch)
tree2f7da47b2ab351dce720f152a6ad609a7820ad40 /src/testdir/test_viminfo.vim
parenta641e1d4da3f9152c489318c06a93fcd1c746637 (diff)
downloadvim-git-ece74ab103eca15e17435efbe9cb21039787f1ea.tar.gz
patch 7.4.1932v7.4.1932
Problem: When writing viminfo the jumplist is not merged with the one in the viminfo file. Solution: Merge based on timestamp.
Diffstat (limited to 'src/testdir/test_viminfo.vim')
-rw-r--r--src/testdir/test_viminfo.vim27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/testdir/test_viminfo.vim b/src/testdir/test_viminfo.vim
index 19be47dd1..64a7e6fee 100644
--- a/src/testdir/test_viminfo.vim
+++ b/src/testdir/test_viminfo.vim
@@ -309,6 +309,33 @@ func Test_viminfo_jumplist()
exe "normal \<C-O>"
call assert_equal('time 05', getline('.'))
+ clearjumps
+ call cursor(1, 1)
+ call test_settime(5)
+ exe "normal /15\r"
+ call test_settime(15)
+ exe "normal /last pos\r"
+ call test_settime(40)
+ exe "normal ?30\r"
+ " Test merge when writing
+ wviminfo Xviminfo
+ clearjumps
+ rviminfo Xviminfo
+
+ exe "normal \<C-O>"
+ call assert_equal('time 30', getline('.'))
+ exe "normal \<C-O>"
+ call assert_equal('last pos', getline('.'))
+ exe "normal \<C-O>"
+ " duplicate for 'time 30' was removed
+ call assert_equal('time 20', getline('.'))
+ exe "normal \<C-O>"
+ call assert_equal('time 15', getline('.'))
+ exe "normal \<C-O>"
+ call assert_equal('time 10', getline('.'))
+ exe "normal \<C-O>"
+ call assert_equal('time 05', getline('.'))
+
bwipe!
call delete('Xviminfo')
endfunc