Diff of /tagmanager/src/tm_workspace.c [c078a1] .. [f1ce9a] Maximize Restore

  Switch to side-by-side view

--- a/tagmanager/src/tm_workspace.c
+++ b/tagmanager/src/tm_workspace.c
@@ -745,25 +745,23 @@
 const TMTag *
 tm_get_current_tag (GPtrArray * file_tags, const gulong line, const guint tag_types)
 {
-	GPtrArray *const local = tm_tags_extract (file_tags, tag_types);
 	TMTag *matching_tag = NULL;
-	if (local && local->len)
+	if (file_tags && file_tags->len)
 	{
 		guint i;
 		gulong matching_line = 0;
 
-		for (i = 0; (i < local->len); ++i)
-		{
-			TMTag *tag = TM_TAG (local->pdata[i]);
-			if (tag->atts.entry.line <= line && tag->atts.entry.line > matching_line)
+		for (i = 0; (i < file_tags->len); ++i)
+		{
+			TMTag *tag = TM_TAG (file_tags->pdata[i]);
+			if (tag && tag->type & tag_types &&
+				tag->atts.entry.line <= line && tag->atts.entry.line > matching_line)
 			{
 				matching_tag = tag;
 				matching_line = tag->atts.entry.line;
 			}
 		}
 	}
-	if (local)
-		g_ptr_array_free (local, TRUE);
 	return matching_tag;
 }