[gnome-builder/wip/tingping/keybindings] keybindings: Add Ctr+h to open find+replace



commit 671157bbe25785e2de5c1efd68006b3739aecd82
Author: Patrick Griffis <tingping tingping se>
Date:   Thu Aug 25 15:58:08 2016 -0400

    keybindings: Add Ctr+h to open find+replace

 data/keybindings/default.css             |    2 ++
 libide/editor/ide-editor-frame-actions.c |   15 +++++++++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/data/keybindings/default.css b/data/keybindings/default.css
index 89e2966..0df4579 100644
--- a/data/keybindings/default.css
+++ b/data/keybindings/default.css
@@ -9,6 +9,8 @@
                   "clear-snippets" ()
                   "hide-completion" () };
   bind "<ctrl>f" { "action" ("frame", "find", "3") };
+  bind "<ctrl>h" { "action" ("frame", "find", "3")
+                   "action" ("frame", "search-replace", "") };
   bind "<ctrl>o" { "action" ("win", "open-with-dialog", "") };
   bind "<ctrl>s" { "action" ("view", "save", "") };
   bind "<ctrl><shift>s" { "action" ("view", "save-as", "") };
diff --git a/libide/editor/ide-editor-frame-actions.c b/libide/editor/ide-editor-frame-actions.c
index ed0fda8..2fe2bcb 100644
--- a/libide/editor/ide-editor-frame-actions.c
+++ b/libide/editor/ide-editor-frame-actions.c
@@ -88,6 +88,20 @@ ide_editor_frame_actions_find (GSimpleAction *action,
 }
 
 static void
+ide_editor_frame_actions_search_replace (GSimpleAction *action,
+                                         GVariant      *variant,
+                                         gpointer       user_data)
+{
+  IdeEditorFrame *self = user_data;
+
+  g_assert (IDE_IS_EDITOR_FRAME (self));
+
+  gtk_widget_set_visible (GTK_WIDGET (self->replace_entry), TRUE);
+  gtk_widget_set_visible (GTK_WIDGET (self->replace_button), TRUE);
+  gtk_widget_set_visible (GTK_WIDGET (self->replace_all_button), TRUE);
+}
+
+static void
 ide_editor_frame_actions_next_search_result (GSimpleAction *action,
                                             GVariant      *variant,
                                             gpointer       user_data)
@@ -386,6 +400,7 @@ ide_editor_frame_actions_replace_confirm (GSimpleAction *action,
 
 static const GActionEntry IdeEditorFrameActions[] = {
   { "find", ide_editor_frame_actions_find, "i" },
+  { "search-replace", ide_editor_frame_actions_search_replace },
   { "next-search-result", ide_editor_frame_actions_next_search_result },
   { "previous-search-result", ide_editor_frame_actions_previous_search_result },
   { "replace-confirm", ide_editor_frame_actions_replace_confirm, "as" },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]