Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Wed, 06 May 2015 17:03:18 UTC
Commit: 5cfc3f20f6525b1c7c8071808fbfdecd2f562189
https://github.com/geany/geany/commit/5cfc3f20f6525b1c7c8071808fbfdecd2f562…
Log Message:
-----------
Merge pull request #487 from techee/goto_tag_fix
Fix language check in tm_workspace_find()
Modified Paths:
--------------
tagmanager/src/tm_workspace.c
Modified: tagmanager/src/tm_workspace.c
30 lines changed, 15 insertions(+), 15 deletions(-)
===================================================================
@@ -686,7 +686,6 @@ const GPtrArray *tm_workspace_find(const char *name, TMTagType type, TMTagAttrTy
TMTag **matches[2];
size_t len;
guint tagCount[2]={0,0}, tagIter;
- gint tags_lang;
if (!name)
return NULL;
@@ -705,11 +704,11 @@ const GPtrArray *tm_workspace_find(const char *name, TMTagType type, TMTagAttrTy
/* file tags */
if (matches[0] && *matches[0])
{
- tags_lang = (*matches[0])->lang;
-
for (tagIter=0;tagIter<tagCount[0];++tagIter)
{
- if ((type & (*matches[0])->type) && (lang == -1 || tags_lang == lang))
+ gint tag_lang = (*matches[0])->lang;
+
+ if ((type & (*matches[0])->type) && (lang == -1 || tag_lang == lang))
g_ptr_array_add(tags, *matches[0]);
if (partial)
{
@@ -728,20 +727,21 @@ const GPtrArray *tm_workspace_find(const char *name, TMTagType type, TMTagAttrTy
/* global tags */
if (matches[1] && *matches[1])
{
- int tags_lang_alt = 0;
- tags_lang = (*matches[1])->lang;
- /* tags_lang_alt is used to load C global tags only once for C and C++
- * lang = 1 is C++, lang = 0 is C
- * if we have lang 0, than accept also lang 1 for C++ */
- if (tags_lang == 0) /* C or C++ */
- tags_lang_alt = 1;
- else
- tags_lang_alt = tags_lang; /* otherwise just ignore it */
-
for (tagIter=0;tagIter<tagCount[1];++tagIter)
{
+ gint tag_lang = (*matches[1])->lang;
+ gint tag_lang_alt = 0;
+
+ /* tag_lang_alt is used to load C global tags only once for C and C++
+ * lang = 1 is C++, lang = 0 is C
+ * if we have lang 0, than accept also lang 1 for C++ */
+ if (tag_lang == 0) /* C or C++ */
+ tag_lang_alt = 1;
+ else
+ tag_lang_alt = tag_lang; /* otherwise just ignore it */
+
if ((type & (*matches[1])->type) && (lang == -1 ||
- tags_lang == lang || tags_lang_alt == lang))
+ tag_lang == lang || tag_lang_alt == lang))
g_ptr_array_add(tags, *matches[1]);
if (partial)
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Wed, 06 May 2015 16:51:43 UTC
Commit: 3973362c1bb844754c7e05e6da5b3c4c278eef13
https://github.com/geany/geany/commit/3973362c1bb844754c7e05e6da5b3c4c278ee…
Log Message:
-----------
Merge pull request #486 from techee/fix_empty_symbol_tree
Fix empty symbol tree under some conditions
Modified Paths:
--------------
src/documentprivate.h
src/sidebar.c
Modified: src/documentprivate.h
2 lines changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -78,6 +78,8 @@ typedef struct GeanyDocumentPrivate
GtkWidget *tag_tree;
/* GtkTreeStore object for this document within the Symbols treeview of the sidebar. */
GtkTreeStore *tag_store;
+ /* Indicates whether tag tree has to be updated */
+ gboolean tag_tree_dirty;
/* Iter for this document within the Open Files treeview of the sidebar. */
GtkTreeIter iter;
/* Used by the Undo/Redo management code. */
Modified: src/sidebar.c
8 lines changed, 6 insertions(+), 2 deletions(-)
===================================================================
@@ -192,6 +192,9 @@ void sidebar_update_tag_list(GeanyDocument *doc, gboolean update)
g_return_if_fail(doc == NULL || doc->is_valid);
+ if (update)
+ doc->priv->tag_tree_dirty = TRUE;
+
if (gtk_notebook_get_current_page(GTK_NOTEBOOK(main_widgets.sidebar_notebook)) != TREEVIEW_SYMBOL)
return; /* don't bother updating symbol tree if we don't see it */
@@ -219,7 +222,7 @@ void sidebar_update_tag_list(GeanyDocument *doc, gboolean update)
return;
}
- if (update)
+ if (doc->priv->tag_tree_dirty)
{ /* updating the tag list in the left tag window */
if (doc->priv->tag_tree == NULL)
{
@@ -232,6 +235,7 @@ void sidebar_update_tag_list(GeanyDocument *doc, gboolean update)
}
doc->has_tags = symbols_recreate_tag_list(doc, SYMBOLS_SORT_USE_PREVIOUS);
+ doc->priv->tag_tree_dirty = FALSE;
}
if (doc->has_tags)
@@ -1088,7 +1092,7 @@ static void on_sidebar_switch_page(GtkNotebook *notebook,
gpointer page, guint page_num, gpointer user_data)
{
if (page_num == TREEVIEW_SYMBOL)
- sidebar_update_tag_list(document_get_current(), TRUE);
+ sidebar_update_tag_list(document_get_current(), FALSE);
}
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Jiří Techet <techet(a)gmail.com>
Committer: Jiří Techet <techet(a)gmail.com>
Date: Wed, 06 May 2015 16:48:14 UTC
Commit: 1903b0a9b9991733dd48f8cd55446200c647efbd
https://github.com/geany/geany/commit/1903b0a9b9991733dd48f8cd55446200c647e…
Log Message:
-----------
Add a flag indicating the tag tree needs updating
When the Symbols tab isn't shown, symbol tree isn't updated. However,
we should record the cases when update should have been performed
and once the symbols tab is shown, perform update if something changed.
Thanks to this patch we also don't have to always perform symbol tree
update when switching to the Symbols tab but only when something has
actually changed.
Modified Paths:
--------------
src/documentprivate.h
src/sidebar.c
Modified: src/documentprivate.h
2 lines changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -78,6 +78,8 @@ typedef struct GeanyDocumentPrivate
GtkWidget *tag_tree;
/* GtkTreeStore object for this document within the Symbols treeview of the sidebar. */
GtkTreeStore *tag_store;
+ /* Indicates whether tag tree has to be updated */
+ gboolean tag_tree_dirty;
/* Iter for this document within the Open Files treeview of the sidebar. */
GtkTreeIter iter;
/* Used by the Undo/Redo management code. */
Modified: src/sidebar.c
8 lines changed, 6 insertions(+), 2 deletions(-)
===================================================================
@@ -192,6 +192,9 @@ void sidebar_update_tag_list(GeanyDocument *doc, gboolean update)
g_return_if_fail(doc == NULL || doc->is_valid);
+ if (update)
+ doc->priv->tag_tree_dirty = TRUE;
+
if (gtk_notebook_get_current_page(GTK_NOTEBOOK(main_widgets.sidebar_notebook)) != TREEVIEW_SYMBOL)
return; /* don't bother updating symbol tree if we don't see it */
@@ -219,7 +222,7 @@ void sidebar_update_tag_list(GeanyDocument *doc, gboolean update)
return;
}
- if (update)
+ if (doc->priv->tag_tree_dirty)
{ /* updating the tag list in the left tag window */
if (doc->priv->tag_tree == NULL)
{
@@ -232,6 +235,7 @@ void sidebar_update_tag_list(GeanyDocument *doc, gboolean update)
}
doc->has_tags = symbols_recreate_tag_list(doc, SYMBOLS_SORT_USE_PREVIOUS);
+ doc->priv->tag_tree_dirty = FALSE;
}
if (doc->has_tags)
@@ -1088,7 +1092,7 @@ static void on_sidebar_switch_page(GtkNotebook *notebook,
gpointer page, guint page_num, gpointer user_data)
{
if (page_num == TREEVIEW_SYMBOL)
- sidebar_update_tag_list(document_get_current(), TRUE);
+ sidebar_update_tag_list(document_get_current(), FALSE);
}
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Jiří Techet <techet(a)gmail.com>
Committer: Jiří Techet <techet(a)gmail.com>
Date: Wed, 06 May 2015 16:37:46 UTC
Commit: 81fb120f508be4b8f472a818b708039c3942b642
https://github.com/geany/geany/commit/81fb120f508be4b8f472a818b708039c3942b…
Log Message:
-----------
Fix language check in tm_workspace_find()
The tags_lang variable is set from the first tag in the found array but
the array may actually contain tags from several languages. This may
lead to two things:
1. Goto tag definition goes to a tag from a different filetype
2. Worse, the first tag is from a different language than the current file
and we get a message that no tag was found
Get lang for every tag in the array and rename tags_lang to tag_lang.
Modified Paths:
--------------
tagmanager/src/tm_workspace.c
Modified: tagmanager/src/tm_workspace.c
30 lines changed, 15 insertions(+), 15 deletions(-)
===================================================================
@@ -686,7 +686,6 @@ const GPtrArray *tm_workspace_find(const char *name, TMTagType type, TMTagAttrTy
TMTag **matches[2];
size_t len;
guint tagCount[2]={0,0}, tagIter;
- gint tags_lang;
if (!name)
return NULL;
@@ -705,11 +704,11 @@ const GPtrArray *tm_workspace_find(const char *name, TMTagType type, TMTagAttrTy
/* file tags */
if (matches[0] && *matches[0])
{
- tags_lang = (*matches[0])->lang;
-
for (tagIter=0;tagIter<tagCount[0];++tagIter)
{
- if ((type & (*matches[0])->type) && (lang == -1 || tags_lang == lang))
+ gint tag_lang = (*matches[0])->lang;
+
+ if ((type & (*matches[0])->type) && (lang == -1 || tag_lang == lang))
g_ptr_array_add(tags, *matches[0]);
if (partial)
{
@@ -728,20 +727,21 @@ const GPtrArray *tm_workspace_find(const char *name, TMTagType type, TMTagAttrTy
/* global tags */
if (matches[1] && *matches[1])
{
- int tags_lang_alt = 0;
- tags_lang = (*matches[1])->lang;
- /* tags_lang_alt is used to load C global tags only once for C and C++
- * lang = 1 is C++, lang = 0 is C
- * if we have lang 0, than accept also lang 1 for C++ */
- if (tags_lang == 0) /* C or C++ */
- tags_lang_alt = 1;
- else
- tags_lang_alt = tags_lang; /* otherwise just ignore it */
-
for (tagIter=0;tagIter<tagCount[1];++tagIter)
{
+ gint tag_lang = (*matches[1])->lang;
+ gint tag_lang_alt = 0;
+
+ /* tag_lang_alt is used to load C global tags only once for C and C++
+ * lang = 1 is C++, lang = 0 is C
+ * if we have lang 0, than accept also lang 1 for C++ */
+ if (tag_lang == 0) /* C or C++ */
+ tag_lang_alt = 1;
+ else
+ tag_lang_alt = tag_lang; /* otherwise just ignore it */
+
if ((type & (*matches[1])->type) && (lang == -1 ||
- tags_lang == lang || tags_lang_alt == lang))
+ tag_lang == lang || tag_lang_alt == lang))
g_ptr_array_add(tags, *matches[1]);
if (partial)
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Frank Lanitz <frank(a)frank.uvena.de>
Committer: Frank Lanitz <frank(a)frank.uvena.de>
Date: Tue, 05 May 2015 17:55:15 UTC
Commit: dbcbd57ee638d410de73032cad29c9a4c9de9a99
https://github.com/geany/geany/commit/dbcbd57ee638d410de73032cad29c9a4c9de9…
Log Message:
-----------
Update of Serbian translation
Modified Paths:
--------------
po/sr.po
Modified: po/sr.po
4736 lines changed, 2439 insertions(+), 2297 deletions(-)
===================================================================
No diff available, check online
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Jiří Techet <techet(a)gmail.com>
Committer: Jiří Techet <techet(a)gmail.com>
Date: Sun, 03 May 2015 17:36:26 UTC
Commit: 5d94d15976ab83f8bea2a6bda866d19a549f787e
https://github.com/geany/geany/commit/5d94d15976ab83f8bea2a6bda866d19a549f7…
Log Message:
-----------
Reload tooltip in the symbol tree also on tag update
Because function return types are not used to determine tag equality,
we need to also update the tooltip of an existing tag otherwise the return
type doesn't get updated when changed.
Modified Paths:
--------------
src/symbols.c
Modified: src/symbols.c
6 lines changed, 5 insertions(+), 1 deletions(-)
===================================================================
@@ -1424,6 +1424,7 @@ static void update_tree_tags(GeanyDocument *doc, GList **tags)
{
const gchar *name;
const gchar *parent_name;
+ gchar *tooltip;
TMTag *found = found_item->data;
parent_name = get_parent_name(found, doc->file_type->id);
@@ -1432,12 +1433,15 @@ static void update_tree_tags(GeanyDocument *doc, GList **tags)
parent_name = NULL;
/* only update fields that (can) have changed (name that holds line
- * number, and the tag itself) */
+ * number, tooltip, and the tag itself) */
name = get_symbol_name(doc, found, parent_name != NULL);
+ tooltip = get_symbol_tooltip(doc, found);
gtk_tree_store_set(store, &iter,
SYMBOLS_COLUMN_NAME, name,
+ SYMBOLS_COLUMN_TOOLTIP, tooltip,
SYMBOLS_COLUMN_TAG, found,
-1);
+ g_free(tooltip);
update_parents_table(parents_table, found, parent_name, &iter);
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).