--- gedit-2.24.2-all_files/gedit/gedit-commands-search.c	2009-02-17 22:08:00.000000000 -0300
+++ /tmp/gedit-2.24.2/gedit/gedit-commands-search.c	2009-02-17 22:45:43.000000000 -0300
@@ -401,35 +401,35 @@ manage_search (SearchAction action, Gedi
 		if (!search_open_docs)
 			break;
 
-			if (search_backwards)
+		if (search_backwards)
+		{
+			if (index == 0)
 			{
-				if (index == 0)
+				if (wrap_around)
 				{
-					if (wrap_around)
-					{
-						index = nviews;
-						wrapped = TRUE;
-					}
-					else
-						break;
+					index = nviews;
+					wrapped = TRUE;
 				}
-				index--;
+				else
+					break;
 			}
-			else
+			index--;
+		}
+		else
+		{
+			index++;
+			if (index == nviews)
 			{
-				index++;
-				if (index == nviews)
+				if (wrap_around)
 				{
-					if (wrap_around)
-					{
-						index = 0;
-						wrapped = TRUE;
-					}
-					else
-						break;
+					index = 0;
+					wrapped = TRUE;
 				}
+				else
+					break;
 			}
-			view = g_list_nth_data (views, index);
+		}
+		view = g_list_nth_data (views, index);
 	}
 	while (search_open_docs);
 
