summary refs log tree commit diff stats
path: root/src/fe-gtk/search.c
diff options
context:
space:
mode:
authorRichard Hitt <rbh00@netcom.com>2012-07-27 11:37:14 +0200
committerBerke Viktor <bviktor@hexchat.org>2012-07-27 11:37:14 +0200
commit8752861b7e70dffe1d5f69ef5e4d63426d7d5d1c (patch)
tree4d1377eee48b4ed17c1bef5e72977253d2c8d92d /src/fe-gtk/search.c
parentb6e62524f488c869476567e5d9c2249731c583d7 (diff)
Remember last search pattern during sessions
Diffstat (limited to 'src/fe-gtk/search.c')
-rw-r--r--src/fe-gtk/search.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/fe-gtk/search.c b/src/fe-gtk/search.c
index c794704c..d45acf9f 100644
--- a/src/fe-gtk/search.c
+++ b/src/fe-gtk/search.c
@@ -156,6 +156,7 @@ void
 search_open (session * sess)
 {
 	GtkWidget *win, *hbox, *vbox, *entry, *wid;
+	gchar *text;
 
 	if (searchwin)
 	{
@@ -173,6 +174,12 @@ search_open (session * sess)
 	gtk_widget_show (hbox);
 
 	entry = gtk_entry_new ();
+	text = GTK_XTEXT (sess->gui->xtext)->buffer->search_text;
+	if (text)
+	{
+		gtk_entry_set_text (GTK_ENTRY (entry), text);
+		gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
+	}
 	g_signal_connect (G_OBJECT (entry), "activate",
 							G_CALLBACK (search_entry_cb), sess);
 	gtk_container_add (GTK_CONTAINER (hbox), entry);