vim-patch:8.0.0499

Problem:    taglist() does not prioritize tags for a buffer.
Solution:   Add an optional buffer argument. (Duncan McDougall, closes vim/vim#1194)

c6aafbaf3e
This commit is contained in:
James McCoy
2017-04-07 16:08:58 -04:00
parent 13352c00f1
commit 20dc04470e
6 changed files with 41 additions and 12 deletions

View File

@@ -26,6 +26,7 @@ source test_tabline.vim
" source test_tabpage.vim
source test_tagcase.vim
source test_tagjump.vim
source test_taglist.vim
source test_true_false.vim
source test_unlet.vim
source test_utf8.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