diff src/testdir/test_tagjump.vim @ 10611:6bff81438f27 v8.0.0195

patch 8.0.0195: fail to jump to static tag in current file commit https://github.com/vim/vim/commit/a9d23c20879d0dcb289a4db54b3c7df060f87c3c Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 16 20:53:34 2017 +0100 patch 8.0.0195: fail to jump to static tag in current file Problem: Jumping to a tag that is a static item in the current file fails. (Kazunobu Kuriyama) Solution: Make sure the first byte of the tag key is not NUL. (Suggested by James McCoy, closes #1387)
author Christian Brabandt <cb@256bit.org>
date Mon, 16 Jan 2017 21:00:04 +0100
parents eb9a7296ae9f
children 0ecd07cd2e43
line wrap: on
line diff
--- a/src/testdir/test_tagjump.vim
+++ b/src/testdir/test_tagjump.vim
@@ -23,6 +23,24 @@ func Test_cancel_ptjump()
   quit
 endfunc
 
+func Test_static_tagjump()
+  set tags=Xtags
+  call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//",
+        \ "one\tXfile1\t/^one/;\"\tf\tfile:\tsignature:(void)",
+        \ "word\tXfile2\tcmd2"],
+        \ 'Xtags')
+  new Xfile1
+  call setline(1, ['empty', 'one()', 'empty'])
+  write
+  tag one
+  call assert_equal(2, line('.'))
+
+  set tags&
+  call delete('Xtags')
+  call delete('Xfile1')
+  bwipe!
+endfunc
+
 " Tests for [ CTRL-I and CTRL-W CTRL-I commands
 function Test_keyword_jump()
   call writefile(["#include Xinclude", "",