Remember last search pattern during sessions

This commit is contained in:
Richard Hitt 2012-07-27 11:37:14 +02:00 committed by Berke Viktor
parent b6e62524f4
commit 8752861b7e
1 changed files with 7 additions and 0 deletions

View File

@ -156,6 +156,7 @@ void
search_open (session * sess) search_open (session * sess)
{ {
GtkWidget *win, *hbox, *vbox, *entry, *wid; GtkWidget *win, *hbox, *vbox, *entry, *wid;
gchar *text;
if (searchwin) if (searchwin)
{ {
@ -173,6 +174,12 @@ search_open (session * sess)
gtk_widget_show (hbox); gtk_widget_show (hbox);
entry = gtk_entry_new (); 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_signal_connect (G_OBJECT (entry), "activate",
G_CALLBACK (search_entry_cb), sess); G_CALLBACK (search_entry_cb), sess);
gtk_container_add (GTK_CONTAINER (hbox), entry); gtk_container_add (GTK_CONTAINER (hbox), entry);