commit ebfbe4db498cbc1dead5a8ea7fc99b574f383696
parent 5e1a3df5ae0c424185930e36c6328da47c8d99e3
Author: zeertzjq <zeertzjq@outlook.com>
Date: Fri, 30 Jan 2026 19:41:02 +0800
vim-patch:9.1.2116: crash when using 'tagfunc' (#37627)
Problem: crash when using 'tagfunc' (Rodrigo Queipo)
Solution: Do not add the user_data to the 'info' dictionary when called
for insert mode completion (the TAG_INS_COMP flag is set).
Completion should not depend on the state of a previous tag
jump. (Yasuhiro Matsumoto)
fixes: vim/vim#19255
closes: vim/vim#19284
https://github.com/vim/vim/commit/57b577df3217b4f28abff6fe3c0a480192927ae2
Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/nvim/tag.c b/src/nvim/tag.c
@@ -1229,7 +1229,7 @@ static int find_tagfunc_tags(char *pat, garray_T *ga, int *match_count, int flag
// create 'info' dict argument
dict_T *const d = tv_dict_alloc_lock(VAR_FIXED);
- if (tag != NULL && tag->user_data != NULL) {
+ if (!(flags & TAG_INS_COMP) && tag != NULL && tag->user_data != NULL) {
tv_dict_add_str(d, S_LEN("user_data"), tag->user_data);
}
if (buf_ffname != NULL) {