diff -upr gedit-2.24.2-search_open/gedit/gedit-commands-search.c gedit-2.24.2/gedit/gedit-commands-search.c
--- gedit-2.24.2-search_open/gedit/gedit-commands-search.c	2009-02-07 19:27:21.000000000 -0200
+++ gedit-2.24.2/gedit/gedit-commands-search.c	2009-02-08 00:20:07.000000000 -0200
@@ -342,10 +342,10 @@ manage_search (GeditWindow *window, Last
 		else
 		{
 			if (index != active_index) {
-				/* it's necessary for "find_again" to set the
-				   same data when switch to other documents.
-				   For normal search this is done by "do_find",
-				   using the dialog settings, before search. */
+				/* When switch to other doc, it is necessary
+				   set the same data, so next time the "Find"
+				   dialog shows up or "Find Next" is run,
+				   options of the last search will be used. */
 				g_object_set_data (G_OBJECT (doc), 
 				                   GEDIT_LAST_SEARCH_DATA_KEY,
 				                   data);
@@ -418,7 +418,9 @@ manage_search (GeditWindow *window, Last
 
 static void
 do_find (GeditSearchDialog *dialog,
-	 GeditWindow       *window)
+	 GeditWindow       *window,
+	 gboolean           backward)
+	/* "backward" will be used only when "dialog" != NULL */
 {
 	GeditView *active_view;
 	GeditDocument *doc;
@@ -426,13 +428,16 @@ do_find (GeditSearchDialog *dialog,
 	gboolean found;
 
 	active_view = gedit_window_get_active_view (window);
-	if (active_view == NULL)
-		return;
+	g_return_if_fail (active_view != NULL);
 
 	doc = GEDIT_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (active_view)));
 
 	data = get_doc_search_data (doc);
-	last_search_data_set (data, dialog);
+
+	if (dialog != NULL)
+		last_search_data_set (data, dialog);
+	else
+		data->backwards = backward;
 
 	found = manage_search (window, data);
 
@@ -441,9 +446,10 @@ do_find (GeditSearchDialog *dialog,
 	else
 		phrase_not_found (window);
 
-	gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
-					   GEDIT_SEARCH_DIALOG_REPLACE_RESPONSE,
-					   found);
+	if (dialog != NULL)
+		gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
+						   GEDIT_SEARCH_DIALOG_REPLACE_RESPONSE,
+						   found);
 }
 
 /* FIXME: move in gedit-document.c and share it with gedit-view */
@@ -500,7 +506,6 @@ do_replace (GeditSearchDialog *dialog,
 	gchar *unescaped_replace_text;
 	gchar *selected_text = NULL;
 	gboolean match_case;
-	gboolean search_backwards;
 
 	doc = gedit_window_get_active_document (window);
 	if (doc == NULL)
@@ -521,7 +526,6 @@ do_replace (GeditSearchDialog *dialog,
 			   NULL);
 
 	match_case = gedit_search_dialog_get_match_case (dialog);
-	search_backwards = gedit_search_dialog_get_backwards (dialog);
 
 	if ((selected_text == NULL) ||
 	    (match_case && (strcmp (selected_text, unescaped_search_text) != 0)) || 
@@ -530,7 +534,8 @@ do_replace (GeditSearchDialog *dialog,
 						    strlen (selected_text), 
 						    strlen (unescaped_search_text)) != 0))
 	{
-		do_find (dialog, window);
+		do_find (dialog, window, FALSE);
+
 		g_free (unescaped_search_text);
 		g_free (selected_text);	
 
@@ -544,7 +549,7 @@ do_replace (GeditSearchDialog *dialog,
 	g_free (selected_text);
 	g_free (unescaped_replace_text);
 	
-	do_find (dialog, window);
+	do_find (dialog, window, FALSE);
 }
 
 static void
@@ -646,7 +651,7 @@ search_dialog_response_cb (GeditSearchDi
 	switch (response_id)
 	{
 		case GEDIT_SEARCH_DIALOG_FIND_RESPONSE:
-			do_find (dialog, window);
+			do_find (dialog, window, FALSE);
 			break;
 		case GEDIT_SEARCH_DIALOG_REPLACE_RESPONSE:
 			do_replace (dialog, window);
@@ -833,39 +838,13 @@ _gedit_cmd_search_replace (GtkAction   *
 	gtk_widget_show (replace_dialog);
 }
 
-static void
-do_find_again (GeditWindow *window,
-	       gboolean     backward)
-{
-	GeditView *active_view;
-	GeditDocument *doc;
-	LastSearchData *data;
-	gboolean found;
-
-	active_view = gedit_window_get_active_view (window);
-	g_return_if_fail (active_view != NULL);
-
-	doc = GEDIT_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (active_view)));
-
-	data = get_doc_search_data (doc);
-
-	data->backwards = backward;
-
-	found = manage_search (window, data);
-
-	if (found)
-		phrase_found (window, 0);
-	else
-		phrase_not_found (window);
-}
-
 void
 _gedit_cmd_search_find_next (GtkAction   *action,
 			    GeditWindow *window)
 {
 	gedit_debug (DEBUG_COMMANDS);
 
-	do_find_again (window, FALSE);
+	do_find (NULL, window, FALSE);
 }
 
 void
@@ -874,7 +853,7 @@ _gedit_cmd_search_find_prev (GtkAction  
 {
 	gedit_debug (DEBUG_COMMANDS);
 
-	do_find_again (window, TRUE);
+	do_find (NULL, window, TRUE);
 }
 
 void
