anjuta r4534 - in trunk: . plugins/search



Author: jhs
Date: Mon Jan  5 11:16:35 2009
New Revision: 4534
URL: http://svn.gnome.org/viewvc/anjuta?rev=4534&view=rev

Log:
2009-01-05  Adam Dingle  <adam medovina org>
 
 	* plugins/search/search-replace.c (write_message_pane):
 	* plugins/search/search-replace_backend.c
 	(file_buffer_new_from_te):
 	Fixed #565885 â Search is broken for a single file with output to find pane 

Modified:
   trunk/ChangeLog
   trunk/plugins/search/search-replace.c
   trunk/plugins/search/search-replace_backend.c

Modified: trunk/plugins/search/search-replace.c
==============================================================================
--- trunk/plugins/search/search-replace.c	(original)
+++ trunk/plugins/search/search-replace.c	Mon Jan  5 11:16:35 2009
@@ -626,26 +626,13 @@
 write_message_pane(IAnjutaMessageView* view, FileBuffer *fb, SearchEntry *se,
 				   MatchInfo *mi)
 {
-	gchar *match_line;
+	gchar *match_line = file_match_line_from_pos(fb, mi->pos);
+	int line = mi->line;
 	char buf[BUFSIZ];
-	gchar *tmp;
 	
-	match_line = file_match_line_from_pos(fb, mi->pos);
-
-	if (SE_BUFFER == se->type)
-	{
-		/* DEBUG_PRINT ("FBPATH  %s\n", fb->path); */
-		const gchar* filename = ianjuta_document_get_filename(IANJUTA_DOCUMENT(se->te), NULL);
-		tmp = g_strrstr(fb->path, "/");
-		tmp = g_strndup(fb->path, tmp + 1 -(fb->path));
-		snprintf(buf, BUFSIZ, "%s%s:%d:%s\n", tmp, filename,
-		         mi->line, match_line);
-		g_free(tmp);
-	}
-	else /* if (SE_FILE == se->type) */
-	{
-		snprintf(buf, BUFSIZ, "%s:%d:%s\n", se->path, mi->line + 1, match_line);
-	}
+	if (se->type == SE_FILE)
+		++line;
+    snprintf(buf, BUFSIZ, "%s:%d:%s\n", fb->path, line, match_line);
 	g_free(match_line);
 	ianjuta_message_view_buffer_append (view, buf, NULL);
 }

Modified: trunk/plugins/search/search-replace_backend.c
==============================================================================
--- trunk/plugins/search/search-replace_backend.c	(original)
+++ trunk/plugins/search/search-replace_backend.c	Mon Jan  5 11:16:35 2009
@@ -120,7 +120,6 @@
 {
 	FileBuffer *fb;
 	GFile* file;
-	gchar* path;
 	
 	g_return_val_if_fail(te, NULL);
 	fb = g_new0(FileBuffer, 1);
@@ -128,7 +127,7 @@
 	fb->te = te;
 	
 	file = ianjuta_file_get_file(IANJUTA_FILE(te), NULL);
-	path = g_file_get_path (file);
+	fb->path = g_file_get_path (file);
 	fb->uri = g_file_get_uri (file);
 	fb->len = ianjuta_editor_get_length(te, NULL);
 	fb->buf = ianjuta_editor_get_text_all (fb->te, NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]