diff options
| author | James McCoy <jamessan@jamessan.com> | 2017-04-07 16:08:58 -0400 |
|---|---|---|
| committer | James McCoy <jamessan@jamessan.com> | 2017-04-07 16:18:04 -0400 |
| commit | 20dc04470e00a369d2ba917a22b06ef2d173953f (patch) | |
| tree | bbafc8b525f5c2d88fe0c30053c8a14178cbaab4 /src/nvim/tag.c | |
| parent | 13352c00f1909d9296c5f276a3735f5e6f231b39 (diff) | |
| download | rneovim-20dc04470e00a369d2ba917a22b06ef2d173953f.tar.gz rneovim-20dc04470e00a369d2ba917a22b06ef2d173953f.tar.bz2 rneovim-20dc04470e00a369d2ba917a22b06ef2d173953f.zip | |
vim-patch:8.0.0499
Problem: taglist() does not prioritize tags for a buffer.
Solution: Add an optional buffer argument. (Duncan McDougall, closes vim/vim#1194)
https://github.com/vim/vim/commit/c6aafbaf3ea755e3ab4ee2e3045911126a08b038
Diffstat (limited to 'src/nvim/tag.c')
| -rw-r--r-- | src/nvim/tag.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/nvim/tag.c b/src/nvim/tag.c index b812dd2ffd..e4ff829807 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -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); |