diff src/tag.c @ 11225:d3415ec1cdaf v8.0.0499

patch 8.0.0499: taglist() does not prioritize tags for a buffer commit https://github.com/vim/vim/commit/c6aafbaf3ea755e3ab4ee2e3045911126a08b038 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Mar 21 17:09:10 2017 +0100 patch 8.0.0499: taglist() does not prioritize tags for a buffer Problem: taglist() does not prioritize tags for a buffer. Solution: Add an optional buffer argument. (Duncan McDougall, closes https://github.com/vim/vim/issues/1194)
author Christian Brabandt <cb@256bit.org>
date Tue, 21 Mar 2017 17:15:05 +0100
parents 501f46f7644c
children 5b524c2286ce
line wrap: on
line diff
--- a/src/tag.c
+++ b/src/tag.c
@@ -3876,11 +3876,11 @@ add_tag_field(
 }
 
 /*
- * Add the tags matching the specified pattern to the list "list"
- * as a dictionary
+ * 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)
+get_tags(list_T *list, char_u *pat, char_u *buf_fname)
 {
     int		num_matches, i, ret;
     char_u	**matches, *p;
@@ -3890,7 +3890,7 @@ get_tags(list_T *list, char_u *pat)
     long	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)