Apply patch from Yura Siamashka to fix wrong navigation queue items (thanks).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2241 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
c49257d14a
commit
9a2be912fc
@ -137,10 +137,8 @@ static void add_new_position(gchar *tm_filename, gint line)
|
||||
|
||||
/* Adds the current document position to the queue before adding the new position.
|
||||
* line is counted with 1 as the first line, not 0. */
|
||||
gboolean navqueue_goto_line(gint new_idx, gint line)
|
||||
gboolean navqueue_goto_line(gint old_idx, gint new_idx, gint line)
|
||||
{
|
||||
gint old_idx = document_get_cur_idx();
|
||||
|
||||
g_return_val_if_fail(DOC_IDX_VALID(old_idx), FALSE);
|
||||
g_return_val_if_fail(DOC_IDX_VALID(new_idx), FALSE);
|
||||
g_return_val_if_fail(doc_list[new_idx].tm_file, FALSE);
|
||||
|
@ -32,7 +32,7 @@ void navqueue_init();
|
||||
void navqueue_free();
|
||||
|
||||
|
||||
gboolean navqueue_goto_line(gint new_idx, gint line);
|
||||
gboolean navqueue_goto_line(gint old_idx, gint new_idx, gint line);
|
||||
|
||||
void navqueue_go_back();
|
||||
|
||||
|
@ -1073,6 +1073,8 @@ gboolean symbols_goto_tag(const gchar *name, gboolean definition)
|
||||
gint type;
|
||||
TMTag *tmtag;
|
||||
|
||||
gint old_idx = document_get_cur_idx();
|
||||
|
||||
// goto tag definition: all except prototypes / forward declarations / externs
|
||||
type = (definition) ? tm_tag_max_t - forward_types : forward_types;
|
||||
|
||||
@ -1087,7 +1089,7 @@ gboolean symbols_goto_tag(const gchar *name, gboolean definition)
|
||||
new_idx = document_open_file(tmtag->atts.entry.file->work_object.file_name, FALSE, NULL, NULL);
|
||||
}
|
||||
|
||||
if (navqueue_goto_line(new_idx, tmtag->atts.entry.line))
|
||||
if (navqueue_goto_line(old_idx, new_idx, tmtag->atts.entry.line))
|
||||
return TRUE;
|
||||
}
|
||||
// if we are here, there was no match and we are beeping ;-)
|
||||
|
@ -641,7 +641,7 @@ static gboolean on_taglist_tree_selection_changed(GtkTreeSelection *selection)
|
||||
{
|
||||
gint idx = document_get_cur_idx();
|
||||
|
||||
navqueue_goto_line(idx, line);
|
||||
navqueue_goto_line(idx, idx, line);
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user