[gedit/gnome-3-10] ViewFrame: select text in the search entry
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/gnome-3-10] ViewFrame: select text in the search entry
- Date: Sun, 2 Feb 2014 21:43:48 +0000 (UTC)
commit 4a4095da685a3d65f659267b351e72c4b95df247
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sun Feb 2 22:16:08 2014 +0100
ViewFrame: select text in the search entry
Steps:
- Ctrl+F and search for 'something', with a least one match
- the match becomes selected in the buffer
- press Enter to quit the search
- press Ctrl+F again
- the search takes the buffer selection to put it in the search entry
What the code did in this case is to put the cursor at the end of the
search text (in the search entry). Now it selects the text.
https://bugzilla.gnome.org/show_bug.cgi?id=723267
gedit/gedit-view-frame.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gedit/gedit-view-frame.c b/gedit/gedit-view-frame.c
index 2ac109d..5a7735a 100644
--- a/gedit/gedit-view-frame.c
+++ b/gedit/gedit-view-frame.c
@@ -1292,11 +1292,17 @@ init_search_entry (GeditViewFrame *frame)
search_text_escaped = gtk_source_utils_escape_search_text (search_text);
}
+ g_signal_handler_block (frame->priv->search_entry,
+ frame->priv->search_entry_changed_id);
+
gtk_entry_set_text (GTK_ENTRY (frame->priv->search_entry),
search_text_escaped);
- gtk_editable_set_position (GTK_EDITABLE (frame->priv->search_entry),
- -1);
+ gtk_editable_select_region (GTK_EDITABLE (frame->priv->search_entry),
+ 0, -1);
+
+ g_signal_handler_unblock (frame->priv->search_entry,
+ frame->priv->search_entry_changed_id);
g_free (search_text_escaped);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]