1
0
forked from aniani/vim

patch 8.0.0499: taglist() does not prioritize tags for a buffer

Problem:    taglist() does not prioritize tags for a buffer.
Solution:   Add an optional buffer argument. (Duncan McDougall, closes #1194)
This commit is contained in:
Bram Moolenaar
2017-03-21 17:09:10 +01:00
parent e94260f358
commit c6aafbaf3e
8 changed files with 44 additions and 10 deletions

View File

@@ -47,6 +47,7 @@ source test_tabline.vim
source test_tabpage.vim
source test_tagcase.vim
source test_tagjump.vim
source test_taglist.vim
source test_timers.vim
source test_true_false.vim
source test_unlet.vim

View File

@@ -0,0 +1,21 @@
" test 'taglist' function
func Test_taglist()
call writefile([
\ "FFoo\tXfoo\t1",
\ "FBar\tXfoo\t2",
\ "BFoo\tXbar\t1",
\ "BBar\tXbar\t2"
\ ], 'Xtags')
set tags=Xtags
split Xtext
call assert_equal(['FFoo', 'BFoo'], map(taglist("Foo"), {i, v -> v.name}))
call assert_equal(['FFoo', 'BFoo'], map(taglist("Foo", "Xtext"), {i, v -> v.name}))
call assert_equal(['FFoo', 'BFoo'], map(taglist("Foo", "Xfoo"), {i, v -> v.name}))
call assert_equal(['BFoo', 'FFoo'], map(taglist("Foo", "Xbar"), {i, v -> v.name}))
call delete('Xtags')
bwipe
endfunc