diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-20 03:56:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-20 03:56:56 +0000 |
commit | 75a9fa68f6cdd6769813a8c5e055bfb00a08c089 (patch) | |
tree | daf1676b4e5ea491b7a370467a24b8181cc21827 /src/testdir/test_viminfo.vim | |
parent | Adding upstream version 2:9.1.0377. (diff) | |
download | vim-75a9fa68f6cdd6769813a8c5e055bfb00a08c089.tar.xz vim-75a9fa68f6cdd6769813a8c5e055bfb00a08c089.zip |
Adding upstream version 2:9.1.0496.upstream/2%9.1.0496
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/testdir/test_viminfo.vim')
-rw-r--r-- | src/testdir/test_viminfo.vim | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/testdir/test_viminfo.vim b/src/testdir/test_viminfo.vim index 1f4a72d..7aab271 100644 --- a/src/testdir/test_viminfo.vim +++ b/src/testdir/test_viminfo.vim @@ -1299,4 +1299,34 @@ func Test_viminfo_merge_old_jumplist() bw! endfunc +func Test_viminfo_oldfiles_filter() + let v:oldfiles = [] + let _viminfofile = &viminfofile + let &viminfofile='' + let lines = [ + \ '# comment line', + \ '*encoding=utf-8', + \ "> /tmp/vimrc_one.vim", + \ "\t\"\t11\t0", + \ "", + \ "> /tmp/foobar.txt", + \ "\t\"\t11\t0", + \ "", + \ ] + call writefile(lines, 'Xviminfo1', 'D') + rviminfo! Xviminfo1 + new + " filter returns a single item + let a = execute('filter /vim/ oldfiles')->split('\n') + call assert_equal(1, len(a)) + " filter returns more than a single match + let a = execute('filter #tmp# oldfiles')->split('\n') + call assert_equal(2, len(a)) + " don't get prompted for the file, but directly open it + filter /vim/ browse oldfiles + call assert_equal("/tmp/vimrc_one.vim", expand("%")) + bw + let &viminfofile = _viminfofile +endfunc + " vim: shiftwidth=2 sts=2 expandtab |