Kaydet (Commit) 3606119d authored tarafından Enrico Tröger's avatar Enrico Tröger

Fixed wrong line numbers for found tags.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@483 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 4a8efb4d
......@@ -4,6 +4,8 @@
* src/callbacks.c, src/keybindings.c:
Remember the active page when toggling the sidebar. Simplified code
for toggling messages window.
* tagmanager/tm_tag.c, tagmanager/tm_workspace.c:
Fixed wrong line numbers for found tags.
2006-06-25 Nick Treleaven <nick.treleaven@btinternet.com>
......
......@@ -197,8 +197,7 @@ TMTag *tm_tag_new(TMSourceFile *file, const tagEntryInfo *tag_entry)
TAG_FREE(tag);
return NULL;
}
// if I don't do the following, tag->atts.file.lang has an undefined value, which is quite bad
tag->atts.file.lang = file->lang;
return tag;
}
......
......@@ -446,6 +446,7 @@ const GPtrArray *tm_workspace_find(const char *name, int type, TMTagAttrType *at
static GPtrArray *tags = NULL;
TMTag **matches[2], **match;
int i, len, tagCount[2]={0,0}, tagIter;
gint tags_lang;
if ((!theWorkspace) || (!name))
return NULL;
......@@ -464,9 +465,18 @@ const GPtrArray *tm_workspace_find(const char *name, int type, TMTagAttrType *at
match = matches[i];
if (match && *match)
{
// for global tags: tag->atts.file.lang contains the language and
// tags->atts.entry.file->lang is NULL
// for "usual" tags: tag->atts.file.lang contains the line of the tag and
// tags->atts.entry.file->lang contains the language
if ((*match)->atts.entry.file != NULL)
tags_lang = (*match)->atts.entry.file->lang;
else
tags_lang = (*match)->atts.file.lang;
for (tagIter=0;tagIter<tagCount[i];++tagIter)
{
if ((type & (*match)->type) && (lang == -1 || (*match)->atts.file.lang == lang))
if ((type & (*match)->type) && (lang == -1 || tags_lang == lang))
g_ptr_array_add(tags, *match);
if (partial)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment