diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-04-08 17:01:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-08 17:01:16 +0200 |
commit | fd4b34af471b3ec485ad82d8e7c47b09d7e90a48 (patch) | |
tree | 1f83acdac4c61866ac59f22fabe0d8d77597ed7b /src/nvim/tag.c | |
parent | 13352c00f1909d9296c5f276a3735f5e6f231b39 (diff) | |
parent | 123931e65e8f6ca3ac13fff8279720c8328a018e (diff) | |
download | rneovim-fd4b34af471b3ec485ad82d8e7c47b09d7e90a48.tar.gz rneovim-fd4b34af471b3ec485ad82d8e7c47b09d7e90a48.tar.bz2 rneovim-fd4b34af471b3ec485ad82d8e7c47b09d7e90a48.zip |
Merge #6473 from jamessan/vim-8.0.0499
vim-patch:8.0.0499,8.0.0550
Diffstat (limited to 'src/nvim/tag.c')
-rw-r--r-- | src/nvim/tag.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/nvim/tag.c b/src/nvim/tag.c index b812dd2ffd..f01b8b8ab1 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -1847,14 +1847,14 @@ parse_line: } } } else { -#define TAG_SEP 0x01 +#define TAG_SEP 0x02 size_t tag_fname_len = STRLEN(tag_fname); // Save the tag in a buffer. - // Use 0x01 to separate fields (Can't use NUL, because the + // Use 0x02 to separate fields (Can't use NUL, because the // hash key is terminated by NUL). - // Emacs tag: <mtt><tag_fname><NUL><ebuf><NUL><lbuf> - // other tag: <mtt><tag_fname><NUL><NUL><lbuf> - // without Emacs tags: <mtt><tag_fname><NUL><lbuf> + // Emacs tag: <mtt><tag_fname><0x02><ebuf><0x02><lbuf><NUL> + // other tag: <mtt><tag_fname><0x02><0x02><lbuf><NUL> + // without Emacs tags: <mtt><tag_fname><0x02><lbuf><NUL> // Here <mtt> is the "mtt" value plus 1 to avoid NUL. len = (int)tag_fname_len + (int)STRLEN(lbuf) + 3; mfp = xmalloc(sizeof(char_u) + len + 1); @@ -2797,11 +2797,9 @@ add_tag_field ( return retval; } -/* - * Add the tags matching the specified pattern to the list "list" - * as a dictionary - */ -int get_tags(list_T *list, char_u *pat) +/// Add the tags matching the specified pattern "pat" to the list "list" +/// as a dictionary. Use "buf_fname" for priority, unless NULL. +int get_tags(list_T *list, char_u *pat, char_u *buf_fname) { int num_matches, i, ret; char_u **matches, *p; @@ -2811,7 +2809,7 @@ int get_tags(list_T *list, char_u *pat) bool is_static; ret = find_tags(pat, &num_matches, &matches, - TAG_REGEXP | TAG_NOIC, (int)MAXCOL, NULL); + TAG_REGEXP | TAG_NOIC, (int)MAXCOL, buf_fname); if (ret == OK && num_matches > 0) { for (i = 0; i < num_matches; ++i) { int parse_result = parse_match(matches[i], &tp); |