[geany/geany-plugins] 9837d2: Merge pull request #465 from StephenWassell/patch-1

Jiří Techet git-noreply at xxxxx
Tue Jul 19 22:57:54 UTC 2016


Branch:      refs/heads/master
Author:      Jiří Techet <techet at gmail.com>
Committer:   GitHub <noreply at github.com>
Date:        Tue, 19 Jul 2016 22:57:54 UTC
Commit:      9837d254a79f3eea3c9f0434ac52e38ceb560c68
             https://github.com/geany/geany-plugins/commit/9837d254a79f3eea3c9f0434ac52e38ceb560c68

Log Message:
-----------
Merge pull request #465 from StephenWassell/patch-1

geanyctags: Go to correct line number when ctags search returns one item


Modified Paths:
--------------
    geanyctags/src/geanyctags.c

Modified: geanyctags/src/geanyctags.c
5 lines changed, 4 insertions(+), 1 deletions(-)
===================================================================
@@ -414,6 +414,7 @@ static void find_tags(const gchar *name, gboolean declaration, gboolean case_sen
 	gchar *tag_filename = NULL;
 	tagEntry entry;
 	tagFileInfo info;
+	int last_line_number = 0;
 
 	prj = geany_data->app->project;
 	if (!prj)
@@ -446,6 +447,7 @@ static void find_tags(const gchar *name, gboolean declaration, gboolean case_sen
 			{
 				path = g_build_filename(prj->base_path, entry.file, NULL);
 				show_entry(&entry);
+				last_line_number = entry.address.lineNumber;
 				num++;
 			}
 			
@@ -456,6 +458,7 @@ static void find_tags(const gchar *name, gboolean declaration, gboolean case_sen
 					if (!path)
 						path = g_build_filename(prj->base_path, entry.file, NULL);
 					show_entry(&entry);
+					last_line_number = entry.address.lineNumber;
 					num++;
 				}
 			}
@@ -465,7 +468,7 @@ static void find_tags(const gchar *name, gboolean declaration, gboolean case_sen
 				GeanyDocument *doc = document_open_file(path, FALSE, NULL, NULL);
 				if (doc != NULL)
 				{
-					navqueue_goto_line(document_get_current(), doc, entry.address.lineNumber);
+					navqueue_goto_line(document_get_current(), doc, last_line_number);
 					gtk_widget_grab_focus(GTK_WIDGET(doc->editor->sci));
 				}
 			}



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Plugins-Commits mailing list