Kaydet (Commit) a2f5700e authored tarafından Nick Treleaven's avatar Nick Treleaven

Make Go to Tag Definition work for all tags except forward

declarations and externs.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1199 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 133a8b7a
2007-01-17 Nick Treleaven <nick.treleaven@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@uvena.de>
* src/vte.c: Use g_shell_quote to avoid problems with special
......
......@@ -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>
......
......@@ -1227,13 +1227,15 @@ void
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 @@ on_goto_tag_activate (GtkMenuItem *menuitem,
}
// 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);
}
......
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