aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-03-19 15:10:27 -0400
committerJames McCoy <jamessan@jamessan.com>2017-03-19 23:43:43 -0400
commit097d04ac71499f5ba0126ab6f731d4f4af0a4e84 (patch)
tree55f49d76464e7874b74e0e8c1bcc10415acf1acd /src/nvim/testdir
parentd3f15f1e6d299796bd552896c0ba01a7cca58618 (diff)
downloadrneovim-097d04ac71499f5ba0126ab6f731d4f4af0a4e84.tar.gz
rneovim-097d04ac71499f5ba0126ab6f731d4f4af0a4e84.tar.bz2
rneovim-097d04ac71499f5ba0126ab6f731d4f4af0a4e84.zip
vim-patch:8.0.0393
Problem: When the same tag appears more than once, the order is unpredictable. (Charles Campbell) Solution: Besides using a dict for finding duplicates, use a grow array for keeping the tags in sequence. https://github.com/vim/vim/commit/98e83b295628bc29bc67bcc1adb8ae75d01b8e07
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_tagjump.vim24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_tagjump.vim b/src/nvim/testdir/test_tagjump.vim
index 54b5f4afd6..2044c23f79 100644
--- a/src/nvim/testdir/test_tagjump.vim
+++ b/src/nvim/testdir/test_tagjump.vim
@@ -35,10 +35,34 @@ func Test_static_tagjump()
tag one
call assert_equal(2, line('.'))
+ bwipe!
set tags&
call delete('Xtags')
call delete('Xfile1')
+endfunc
+
+func Test_duplicate_tagjump()
+ set tags=Xtags
+ call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//",
+ \ "thesame\tXfile1\t1;\"\td\tfile:",
+ \ "thesame\tXfile1\t2;\"\td\tfile:",
+ \ "thesame\tXfile1\t3;\"\td\tfile:",
+ \ ],
+ \ 'Xtags')
+ new Xfile1
+ call setline(1, ['thesame one', 'thesame two', 'thesame three'])
+ write
+ tag thesame
+ call assert_equal(1, line('.'))
+ tnext
+ call assert_equal(2, line('.'))
+ tnext
+ call assert_equal(3, line('.'))
+
bwipe!
+ set tags&
+ call delete('Xtags')
+ call delete('Xfile1')
endfunc
" vim: shiftwidth=2 sts=2 expandtab