diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-03-09 08:17:52 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-03-09 08:17:52 +0100 |
commit | 283e5f4e69b204e0eafd408548e69b7ca9b4871b (patch) | |
tree | cd8282fab5f965254d87af762fe9bdcd67e5c30d /src/tag.c | |
parent | 693e80e93897aff3b07a1ef12b68a6527702f3d7 (diff) | |
download | vim-git-283e5f4e69b204e0eafd408548e69b7ca9b4871b.tar.gz |
patch 8.2.0365: tag kind can't be a multi-byte characterv8.2.0365
Problem: Tag kind can't be a multi-byte character. (Marcin Szamotulski)
Solution: Recognize multi-byte character. (closes #5724)
Diffstat (limited to 'src/tag.c')
-rw-r--r-- | src/tag.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -3229,7 +3229,9 @@ parse_match( tagp->command_end = p; p += 2; // skip ";\"" if (*p++ == TAB) - while (ASCII_ISALPHA(*p)) + // Accept ASCII alphabetic kind characters and any multi-byte + // character. + while (ASCII_ISALPHA(*p) || mb_ptr2len(p) > 1) { if (STRNCMP(p, "kind:", 5) == 0) tagp->tagkind = p + 5; @@ -3245,20 +3247,21 @@ parse_match( tagp->tagkind = p; if (pt == NULL) break; - p = pt + 1; + p = pt; + MB_PTR_ADV(p); } } if (tagp->tagkind != NULL) { for (p = tagp->tagkind; - *p && *p != '\t' && *p != '\r' && *p != '\n'; ++p) + *p && *p != '\t' && *p != '\r' && *p != '\n'; MB_PTR_ADV(p)) ; tagp->tagkind_end = p; } if (tagp->user_data != NULL) { for (p = tagp->user_data; - *p && *p != '\t' && *p != '\r' && *p != '\n'; ++p) + *p && *p != '\t' && *p != '\r' && *p != '\n'; MB_PTR_ADV(p)) ; tagp->user_data_end = p; } @@ -4006,7 +4009,7 @@ get_tags(list_T *list, char_u *pat, char_u *buf_fname) if (tp.command_end != NULL) { for (p = tp.command_end + 3; - *p != NUL && *p != '\n' && *p != '\r'; ++p) + *p != NUL && *p != '\n' && *p != '\r'; MB_PTR_ADV(p)) { if (p == tp.tagkind || (p + 5 == tp.tagkind && STRNCMP(p, "kind:", 5) == 0)) |