SF.net SVN: geany:[5246] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Tue Sep 21 16:16:15 UTC 2010


Revision: 5246
          http://geany.svn.sourceforge.net/geany/?rev=5246&view=rev
Author:   ntrel
Date:     2010-09-21 16:16:15 +0000 (Tue, 21 Sep 2010)

Log Message:
-----------
Move find_again() to search.c.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/callbacks.c
    trunk/src/search.c
    trunk/src/search.h

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2010-09-21 16:05:10 UTC (rev 5245)
+++ trunk/ChangeLog	2010-09-21 16:16:15 UTC (rev 5246)
@@ -3,6 +3,8 @@
  * src/interface.c, geany.glade:
    Move Go to Marker menu items to Search menu.
    Rename popup editor menu item Commands -> Edit.
+ * src/callbacks.c, src/search.c, src/search.h:
+   Move find_again() to search.c.
 
 
 2010-09-20  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>

Modified: trunk/src/callbacks.c
===================================================================
--- trunk/src/callbacks.c	2010-09-21 16:05:10 UTC (rev 5245)
+++ trunk/src/callbacks.c	2010-09-21 16:16:15 UTC (rev 5246)
@@ -1118,33 +1118,11 @@
 }
 
 
-static void find_again(gboolean change_direction)
-{
-	GeanyDocument *doc = document_get_current();
-
-	g_return_if_fail(doc != NULL);
-
-	if (search_data.text)
-	{
-		gboolean forward = ! search_data.backwards;
-		gint result = document_find_text(doc, search_data.text, search_data.flags,
-			change_direction ? forward : !forward, FALSE, NULL);
-
-		if (result > -1)
-			editor_display_current_line(doc->editor, 0.3F);
-
-		if (search_data.search_bar)
-			ui_set_search_entry_background(
-				toolbar_get_widget_child_by_name("SearchEntry"), (result > -1));
-	}
-}
-
-
 void
 on_find_next1_activate                 (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
-	find_again(FALSE);
+	search_find_again(FALSE);
 }
 
 
@@ -1156,7 +1134,7 @@
 		/* Can't reverse search order for a regex (find next ignores search backwards) */
 		utils_beep();
 	else
-		find_again(TRUE);
+		search_find_again(TRUE);
 }
 
 

Modified: trunk/src/search.c
===================================================================
--- trunk/src/search.c	2010-09-21 16:05:10 UTC (rev 5245)
+++ trunk/src/search.c	2010-09-21 16:16:15 UTC (rev 5246)
@@ -42,6 +42,7 @@
 #include "project.h"
 #include "keyfile.h"
 #include "stash.h"
+#include "toolbar.h"
 
 #include <unistd.h>
 #include <string.h>
@@ -1943,3 +1944,25 @@
 }
 
 
+void search_find_again(gboolean change_direction)
+{
+	GeanyDocument *doc = document_get_current();
+
+	g_return_if_fail(doc != NULL);
+
+	if (search_data.text)
+	{
+		gboolean forward = ! search_data.backwards;
+		gint result = document_find_text(doc, search_data.text, search_data.flags,
+			change_direction ? forward : !forward, FALSE, NULL);
+
+		if (result > -1)
+			editor_display_current_line(doc->editor, 0.3F);
+
+		if (search_data.search_bar)
+			ui_set_search_entry_background(
+				toolbar_get_widget_child_by_name("SearchEntry"), (result > -1));
+	}
+}
+
+

Modified: trunk/src/search.h
===================================================================
--- trunk/src/search.h	2010-09-21 16:05:10 UTC (rev 5245)
+++ trunk/src/search.h	2010-09-21 16:16:15 UTC (rev 5246)
@@ -75,6 +75,8 @@
 
 gint search_find_text(struct _ScintillaObject *sci, gint flags, struct Sci_TextToFind *ttf);
 
+void search_find_again(gboolean change_direction);
+
 void search_find_usage(const gchar *search_text, gint flags, gboolean in_session);
 
 void search_find_selection(GeanyDocument *doc, gboolean search_backwards);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list