vim-patch:9.1.0428: Tag guessing leaves wrong search history with very short names

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: vim/vim#14817

42cd192daa

Cherry-pick Test_tagbsearch() changes from patch 9.0.0767.
This commit is contained in:
zeertzjq
2024-05-22 05:35:21 +08:00
parent b86381f425
commit 59fe8ffdea
2 changed files with 21 additions and 5 deletions

View File

@@ -2978,7 +2978,7 @@ static int jumpto_tag(const char *lbuf_arg, int forceit, bool keep_help)
// Guess again: "^char * \<func ("
pbuflen = (size_t)snprintf(pbuf, LSIZE, "^\\[#a-zA-Z_]\\.\\*\\<%s\\s\\*(",
tagp.tagname);
if (!do_search(NULL, '/', '/', pbuf, len, 1, search_options, NULL)) {
if (!do_search(NULL, '/', '/', pbuf, pbuflen, 1, search_options, NULL)) {
found = 0;
}
}