SF.net SVN: geany: [1199] trunk
ntrel at users.sourceforge.net
ntrel at xxxxx
Wed Jan 17 17:42:23 UTC 2007
Revision: 1199
http://svn.sourceforge.net/geany/?rev=1199&view=rev
Author: ntrel
Date: 2007-01-17 09:42:23 -0800 (Wed, 17 Jan 2007)
Log Message:
-----------
Make Go to Tag Definition work for all tags except forward
declarations and externs.
Modified Paths:
--------------
trunk/ChangeLog
trunk/doc/geany.docbook
trunk/src/callbacks.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2007-01-16 15:57:00 UTC (rev 1198)
+++ trunk/ChangeLog 2007-01-17 17:42:23 UTC (rev 1199)
@@ -1,3 +1,10 @@
+2007-01-17 Nick Treleaven <nick.treleaven at btinternet.com>
+
+ * src/callbacks.c, doc/geany.docbook:
+ Make Go to Tag Definition work for all tags except forward
+ declarations and externs.
+
+
2007-01-16 Enrico Tröger <enrico.troeger at uvena.de>
* src/vte.c: Use g_shell_quote to avoid problems with special
Modified: trunk/doc/geany.docbook
===================================================================
--- trunk/doc/geany.docbook 2007-01-16 15:57:00 UTC (rev 1198)
+++ trunk/doc/geany.docbook 2007-01-17 17:42:23 UTC (rev 1199)
@@ -576,11 +576,11 @@
see the entry for '\n' in <xref linkend="regexp"/>.
</para>
</section>
- <section>
+ <section id="go_to_tag">
<title>Go to tag definition</title>
<para>
- If the current word is the name of a function and the file containing the
- function definition (a.k.a. function body) is open, Go to tag definition will
+ If the current word is the name of a tag definition (like a function body)
+ and the file containing the tag definition is open, this command will
switch to that file and go to the corresponding line number.
The current word is either taken from the word nearest the edit cursor, or
the word underneath the popup menu click position when the popup menu is
@@ -590,8 +590,9 @@
<section>
<title>Go to tag declaration</title>
<para>
- Like Go to tag definition, but for a forward function declaration (a.k.a.
- function prototype) instead of a function definition.
+ Like Go to tag definition, but for a forward declaration such as a
+ function prototype or <literal>extern</literal> declaration instead
+ of a function body.
</para>
</section>
<section>
@@ -1400,7 +1401,7 @@
<entry>Jump to the definition of the current word (near the
keyboard cursor). If the definition cannot be found (e.g. the
relevant file is not open) <application>Geany</application>
- will beep and do nothing. Used for function definitions.
+ will beep and do nothing. See <xref linkend="go_to_tag"/>.
</entry>
</row>
<row>
@@ -1408,7 +1409,7 @@
<entry>Jump to the declaration of the current word (near the
keyboard cursor). If the declaration cannot be found (e.g. the
relevant file is not open) <application>Geany</application>
- will beep and do nothing. Used for function prototypes.
+ will beep and do nothing. See <xref linkend="go_to_tag"/>.
</entry>
</row>
</tbody>
Modified: trunk/src/callbacks.c
===================================================================
--- trunk/src/callbacks.c 2007-01-16 15:57:00 UTC (rev 1198)
+++ trunk/src/callbacks.c 2007-01-17 17:42:23 UTC (rev 1199)
@@ -1227,13 +1227,15 @@
on_goto_tag_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
+ const gint forward_types = tm_tag_prototype_t | tm_tag_externvar_t;
gint type;
TMTag *tmtag;
+ // goto tag definition: all except prototypes / forward declarations / externs
if (menuitem == GTK_MENU_ITEM(lookup_widget(app->popup_menu, "goto_tag_definition1")))
- type = tm_tag_function_t;
+ type = tm_tag_max_t - forward_types;
else
- type = tm_tag_prototype_t;
+ type = forward_types;
tmtag = symbols_find_in_workspace(editor_info.current_word, type);
if (tmtag != NULL)
@@ -1245,10 +1247,10 @@
}
// if we are here, there was no match and we are beeping ;-)
utils_beep();
- if (type == tm_tag_prototype_t)
- ui_set_statusbar(_("Declaration of \"%s()\" not found"), editor_info.current_word);
+ if (type == forward_types)
+ ui_set_statusbar(_("Forward declaration \"%s\" not found."), editor_info.current_word);
else
- ui_set_statusbar(_("Definition of \"%s()\" not found"), editor_info.current_word);
+ ui_set_statusbar(_("Definition of \"%s\" not found."), editor_info.current_word);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list