Branch: refs/heads/master
Author: Jiří Techet <techet(a)gmail.com>
Committer: Jiří Techet <techet(a)gmail.com>
Date: Sat, 05 Mar 2016 10:10:38 UTC
Commit: c84c41e44a69727a51abebf58936b65bd80659c6
https://github.com/geany/geany/commit/c84c41e44a69727a51abebf58936b65bd8065…
Log Message:
-----------
Don't show the goto popup for typedef synonyms
For instance when performing goto tag for Foo and Foo is defined as
typedef struct Foo {} Foo;
go immediately to the struct location without showing the goto popup with
both the struct name and typedef. When there are more occurrences of the
name, filter the list and don't show the synonyms in the popup.
In addition, if the cursor is on the same line as the typedef, go to
the struct and vice versa.
Note the missing
g_strcmp0(second->var_type, first->name) == 0
in the check - in this particular case we won't get the type to which the
typedef refers inside var_type because at the time the typedef tag is
generated in c.c the struct tag doesn't exist yet. On the other hand
there's no second->var_type == NULL either because this behaviour seems
to be rather implementation-specific and might easily change in the
future. The existing checks are probably sufficient for the real-world
code.
Modified Paths:
--------------
src/symbols.c
Modified: src/symbols.c
31 lines changed, 27 insertions(+), 4 deletions(-)
===================================================================
@@ -2075,12 +2075,13 @@ static gboolean goto_tag(const gchar *name, gboolean definition)
{
const TMTagType forward_types = tm_tag_prototype_t | tm_tag_externvar_t;
TMTagType type;
- TMTag *tmtag = NULL;
+ TMTag *tmtag, *last_tag;
GeanyDocument *old_doc = document_get_current();
gboolean found = FALSE;
const GPtrArray *all_tags;
- GPtrArray *workspace_tags;
+ GPtrArray *workspace_tags, *filtered_tags;
guint i;
+ guint current_line = sci_get_current_line(old_doc->editor->sci) + 1;
/* goto tag definition: all except prototypes / forward declarations / externs */
type = (definition) ? tm_tag_max_t - forward_types : forward_types;
@@ -2094,6 +2095,29 @@ static gboolean goto_tag(const gchar *name, gboolean definition)
g_ptr_array_add(workspace_tags, tmtag);
}
+ /* If there are typedefs of e.g. a struct such as "typedef struct Foo {} Foo;",
+ * keep just one of the names in the list - when the cursor is on the struct
+ * name, keep the typename, otherwise keep the struct name. */
+ last_tag = NULL;
+ filtered_tags = g_ptr_array_new();
+ foreach_ptr_array(tmtag, i, workspace_tags)
+ {
+ if (last_tag != NULL && last_tag->file == tmtag->file &&
+ last_tag->type != tm_tag_typedef_t && tmtag->type == tm_tag_typedef_t)
+ {
+ if (last_tag->line == current_line && filtered_tags->len > 0)
+ /* if cursor on struct, replace struct with the typedef */
+ filtered_tags->pdata[filtered_tags->len-1] = tmtag;
+ /* if cursor anywhere else, use struct (already added) and discard typedef */
+ }
+ else
+ g_ptr_array_add(filtered_tags, tmtag);
+
+ last_tag = tmtag;
+ }
+ g_ptr_array_free(workspace_tags, TRUE);
+ workspace_tags = filtered_tags;
+
if (workspace_tags->len == 1)
{
GeanyDocument *new_doc;
@@ -2105,8 +2129,7 @@ static gboolean goto_tag(const gchar *name, gboolean definition)
if (new_doc)
{
/* If we are already on the tag line, swap definition/declaration */
- if (new_doc == old_doc &&
- tmtag->line == (guint)sci_get_current_line(old_doc->editor->sci) + 1)
+ if (new_doc == old_doc && tmtag->line == current_line)
{
if (goto_tag(name, !definition))
found = TRUE;
--------------
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: Fri, 04 Mar 2016 22:21:23 UTC
Commit: 9a854751e1d5ae2be0d3714eae83111ded7c8a20
https://github.com/geany/geany/commit/9a854751e1d5ae2be0d3714eae83111ded7c8…
Log Message:
-----------
Fix GtkDoc header generation script to handle references inside typedef
Modified Paths:
--------------
scripts/gen-api-gtkdoc.py
Modified: scripts/gen-api-gtkdoc.py
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -370,7 +370,7 @@ def main(args):
for f in h_files:
if not (f.find("compoundname").text.endswith("private.h")):
for n0 in f.xpath(".//*/memberdef[@kind='typedef' and @prot='public']"):
- if not (n0.find("type").text.startswith("enum")):
+ if not (DoxygenProcess.stringify_children(n0.find("type")).startswith("enum")):
e = DoxyTypedef.from_memberdef(n0)
typedefs.append(e)
--------------
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: Thu, 03 Mar 2016 14:00:15 UTC
Commit: debe14549d6c9ae488ae4fb2be20315a27d39e5d
https://github.com/geany/geany/commit/debe14549d6c9ae488ae4fb2be20315a27d39…
Log Message:
-----------
Improve API docs related to keybindings configuration file
Modified Paths:
--------------
src/keybindings.c
src/pluginutils.c
Modified: src/keybindings.c
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -161,7 +161,7 @@ GeanyKeyBinding *keybindings_get_item(GeanyKeyGroup *group, gsize key_id)
* Usually it's better to use the group callback instead - see plugin_set_key_group().
* @param key Default key, e.g. @c GDK_j (must be lower case), but usually 0 for unset.
* @param mod Default modifier, e.g. @c GDK_CONTROL_MASK, but usually 0 for unset.
- * @param kf_name Key name for the configuration file, such as @c "menu_new".
+ * @param kf_name Key name used for this item in the keybindings configuration file, i.e. @c "menu_new".
* @param label Label used in the preferences dialog keybindings tab. May contain
* underscores - these won't be displayed.
* @param menu_item @nullable Optional widget to set an accelerator for, or @c NULL.
@@ -214,7 +214,7 @@ GeanyKeyBinding *keybindings_set_item(GeanyKeyGroup *group, gsize key_id,
* @param key_id Keybinding index for the group.
* @param key Default key, e.g. @c GDK_j (must be lower case), but usually 0 for unset.
* @param mod Default modifier, e.g. @c GDK_CONTROL_MASK, but usually 0 for unset.
- * @param kf_name Key name for the configuration file, such as @c "menu_new".
+ * @param kf_name Key name used for this item in the keybindings configuration file, i.e. @c "menu_new".
* @param label Label used in the preferences dialog keybindings tab. May contain
* underscores - these won't be displayed.
* @param menu_item @nullable Optional widget to set an accelerator for, or @c NULL.
Modified: src/pluginutils.c
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -298,7 +298,7 @@ guint plugin_idle_add(GeanyPlugin *plugin, GSourceFunc function, gpointer data)
* Sets up or resizes a keybinding group for the plugin.
* You should then call keybindings_set_item() for each keybinding in the group.
* @param plugin Must be @ref geany_plugin.
- * @param section_name Name used in the configuration file, such as @c "html_chars".
+ * @param section_name Name of the section used for this group in the keybindings configuration file, i.e. @c "html_chars".
* @param count Number of keybindings for the group.
* @param callback @nullable Group callback, or @c NULL if you only want individual keybinding callbacks.
* @return The plugin's keybinding group.
@@ -320,7 +320,7 @@ GeanyKeyGroup *plugin_set_key_group(GeanyPlugin *plugin,
* You should then call keybindings_set_item() or keybindings_set_item_full() for each
* keybinding in the group.
* @param plugin Must be @ref geany_plugin.
- * @param section_name Name used in the configuration file, such as @c "html_chars".
+ * @param section_name Name of the section used for this group in the keybindings configuration file, i.e. @c "html_chars".
* @param count Number of keybindings for the group.
* @param cb @nullable New-style group callback, or @c NULL if you only want individual keybinding callbacks.
* @param pdata Plugin specific data, passed to the group callback @a cb.
--------------
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: Thu, 03 Mar 2016 13:49:37 UTC
Commit: 78c6a2ad6dfafb206024e828cb76ec3229768ab4
https://github.com/geany/geany/commit/78c6a2ad6dfafb206024e828cb76ec3229768…
Log Message:
-----------
Fix check for GtkDoc header generation dependencies
The checks itself were correct, but the logic for the final decision
didn't properly handle `--enable-gtkdoc-header=auto`, which also
happens to be the default.
Also fix hiding error messages from Python when trying to import the
`lxml` module to see whether it's available or not.
Closes #929.
Modified Paths:
--------------
m4/geany-gtkdoc-header.m4
Modified: m4/geany-gtkdoc-header.m4
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -26,7 +26,7 @@ AC_DEFUN([GEANY_CHECK_GTKDOC_HEADER],
AS_IF([test "x$have_python" = xyes],
[have_python_and_lxml=yes
AC_MSG_CHECKING([for python lxml package])
- AS_IF([$PYTHON -c 'import lxml' 2>&1 >/dev/null],
+ AS_IF([$PYTHON -c 'import lxml' >/dev/null 2>&1],
[have_python_and_lxml=yes],
[have_python_and_lxml=no])
AC_MSG_RESULT([$have_python_and_lxml])],
@@ -34,7 +34,7 @@ AC_DEFUN([GEANY_CHECK_GTKDOC_HEADER],
dnl final result
AS_IF([test "x$geany_enable_gtkdoc_header$have_python_and_lxml" = "xyesno"],
[_GEANY_CHECK_GTKDOC_HEADER_ERROR([python or its lxml module not found])],
- [geany_enable_gtkdoc_header=yes])
+ [geany_enable_gtkdoc_header=$have_python_and_lxml])
])
AM_CONDITIONAL([ENABLE_GTKDOC_HEADER], [test "x$geany_enable_gtkdoc_header" = "xyes"])
--------------
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: Wed, 02 Mar 2016 18:59:46 UTC
Commit: 0619801b74b6d0575ee422363abd92eefa78248e
https://github.com/geany/geany/commit/0619801b74b6d0575ee422363abd92eefa782…
Log Message:
-----------
Small update of German translation
Modified Paths:
--------------
po/de.po
Modified: po/de.po
544 lines changed, 272 insertions(+), 272 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: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Tue, 01 Mar 2016 21:31:47 UTC
Commit: 6ba26cf1fe35375e589ef6f4e8bb290265388904
https://github.com/geany/geany/commit/6ba26cf1fe35375e589ef6f4e8bb290265388…
Log Message:
-----------
Use "symbol" instead of "tag" in comments too
Modified Paths:
--------------
src/symbols.c
Modified: src/symbols.c
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -1979,10 +1979,10 @@ static void show_goto_popup(GeanyDocument *doc, GPtrArray *tags, gboolean have_b
gchar *text;
if (! first && have_best)
- /* For translators: it's the filename and line number of a tag in the goto-tag popup menu */
+ /* For translators: it's the filename and line number of a symbol in the goto-symbol popup menu */
text = g_markup_printf_escaped(_("<b>%s: %lu</b>"), fname, tmtag->line);
else
- /* For translators: it's the filename and line number of a tag in the goto-tag popup menu */
+ /* For translators: it's the filename and line number of a symbol in the goto-symbol popup menu */
text = g_markup_printf_escaped(_("%s: %lu"), fname, tmtag->line);
image = gtk_image_new_from_pixbuf(symbols_icons[get_tag_class(tmtag)].pixbuf);
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).