Revision: 2332 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=2332&view=re... Author: frlan Date: 2011-11-12 12:28:24 +0000 (Sat, 12 Nov 2011) Log Message: ----------- GeanyVC: Remember line position if using blame
Modified Paths: -------------- trunk/geany-plugins/geanyvc/src/geanyvc.c
Modified: trunk/geany-plugins/geanyvc/src/geanyvc.c =================================================================== --- trunk/geany-plugins/geanyvc/src/geanyvc.c 2011-11-11 14:28:06 UTC (rev 2331) +++ trunk/geany-plugins/geanyvc/src/geanyvc.c 2011-11-12 12:28:24 UTC (rev 2332) @@ -375,7 +375,8 @@ /* name should be in UTF-8, and can have a path. */ static void show_output(const gchar * std_output, const gchar * name, - const gchar * force_encoding, GeanyFiletype * ftype) + const gchar * force_encoding, GeanyFiletype * ftype, + gint line) { gint page; GtkNotebook *book; @@ -388,6 +389,11 @@ if (doc == NULL) { doc = document_new_file(name, ftype, std_output); + if (line == 0) + { + line = 1; + } + } else { @@ -400,7 +406,9 @@ } document_set_text_changed(doc, set_changed_flag); document_set_encoding(doc, (force_encoding ? force_encoding : "UTF-8")); - navqueue_goto_line(cur_doc, doc, 1); + + navqueue_goto_line(cur_doc, doc, line); + } else { @@ -626,7 +634,7 @@ else { name = g_strconcat(doc->file_name, ".vc.diff", NULL); - show_output(text, name, doc->encoding, NULL); + show_output(text, name, doc->encoding, NULL, 0); g_free(text); g_free(name); } @@ -678,7 +686,7 @@ { gchar *name; name = g_strconcat(dir, ".vc.diff", NULL); - show_output(text, name, doc->encoding, NULL); + show_output(text, name, doc->encoding, NULL, 0); g_free(text); g_free(name); } @@ -705,7 +713,8 @@ execute_command(vc, &text, NULL, doc->file_name, VC_COMMAND_BLAME, NULL, NULL); if (text) { - show_output(text, "*VC-BLAME*", NULL, doc->file_type); + show_output(text, "*VC-BLAME*", NULL, + doc->file_type, sci_get_current_line(doc->editor->sci)); g_free(text); } else @@ -731,7 +740,7 @@ execute_command(vc, &output, NULL, doc->file_name, VC_COMMAND_LOG_FILE, NULL, NULL); if (output) { - show_output(output, "*VC-LOG*", NULL, NULL); + show_output(output, "*VC-LOG*", NULL, NULL, 0); g_free(output); } } @@ -755,7 +764,7 @@ execute_command(vc, &text, NULL, base_name, VC_COMMAND_LOG_DIR, NULL, NULL); if (text) { - show_output(text, "*VC-LOG*", NULL, NULL); + show_output(text, "*VC-LOG*", NULL, NULL, 0); g_free(text); }
@@ -782,7 +791,7 @@ execute_command(vc, &text, NULL, basedir, VC_COMMAND_LOG_DIR, NULL, NULL); if (text) { - show_output(text, "*VC-LOG*", NULL, NULL); + show_output(text, "*VC-LOG*", NULL, NULL, 0); g_free(text); } g_free(basedir); @@ -813,7 +822,7 @@ execute_command(vc, &text, NULL, base_name, VC_COMMAND_STATUS, NULL, NULL); if (text) { - show_output(text, "*VC-STATUS*", NULL, NULL); + show_output(text, "*VC-STATUS*", NULL, NULL, 0); g_free(text); }
@@ -838,7 +847,7 @@ { gchar *name; name = g_strconcat(doc->file_name, ".vc.orig", NULL); - show_output(output, name, doc->encoding, doc->file_type); + show_output(output, name, doc->encoding, doc->file_type, 0); g_free(name); g_free(output); } @@ -954,7 +963,7 @@ document_reload_file(doc, NULL);
if (NZV(text)) - show_output(text, "*VC-UPDATE*", NULL, NULL); + show_output(text, "*VC-UPDATE*", NULL, NULL, 0); g_free(text); } }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.