summaryrefslogtreecommitdiffstats
path: root/src/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-05-21 17:19:58 +0200
committerChristian Brabandt <cb@256bit.org>2024-05-21 17:19:58 +0200
commit42cd192daa4b7f29131c7be1beaecb6067e96266 (patch)
treec7538612398bd6b69d76bec143a2fdf507082968 /src/testdir
parentffed1540f36eb4a2255d7d824c9466d3d8fd581e (diff)
patch 9.1.0428: Tag guessing leaves wrong search history with very short namesv9.1.0428
Problem: Tag guessing leaves wrong search history with very short names (after 9.1.0426). Solution: Use the correct variable for pattern length (zeertzjq). closes: #14817 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_tagjump.vim18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/testdir/test_tagjump.vim b/src/testdir/test_tagjump.vim
index 2abf1f6595..432906efbf 100644
--- a/src/testdir/test_tagjump.vim
+++ b/src/testdir/test_tagjump.vim
@@ -1560,4 +1560,22 @@ func Test_tagbsearch()
set tags& tagbsearch&
endfunc
+" Test tag guessing with very short names
+func Test_tag_guess_short()
+ call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//",
+ \ "y\tXf\t/^y()/"],
+ \ 'Xt', 'D')
+ set tags=Xt cpoptions+=t
+ call writefile(['', 'int * y () {}', ''], 'Xf', 'D')
+
+ let v:statusmsg = ''
+ let @/ = ''
+ ta y
+ call assert_match('E435:', v:statusmsg)
+ call assert_equal(2, line('.'))
+ call assert_match('<y', @/)
+
+ set tags& cpoptions-=t
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab