Commit 3b6cff71 authored by Sébastien Wilmet's avatar Sébastien Wilmet

Regex search, finally

Regex errors are not reported, but it's usable.
parent 395b7b46
......@@ -46,6 +46,7 @@ struct _GeditReplaceDialogPrivate
GtkWidget *replace_text_entry;
GtkWidget *match_case_checkbutton;
GtkWidget *entire_word_checkbutton;
GtkWidget *regex_checkbutton;
GtkWidget *backwards_checkbutton;
GtkWidget *wrap_around_checkbutton;
......@@ -144,6 +145,7 @@ gedit_replace_dialog_class_init (GeditReplaceDialogClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GeditReplaceDialog, replace_label);
gtk_widget_class_bind_template_child_private (widget_class, GeditReplaceDialog, match_case_checkbutton);
gtk_widget_class_bind_template_child_private (widget_class, GeditReplaceDialog, entire_word_checkbutton);
gtk_widget_class_bind_template_child_private (widget_class, GeditReplaceDialog, regex_checkbutton);
gtk_widget_class_bind_template_child_private (widget_class, GeditReplaceDialog, backwards_checkbutton);
gtk_widget_class_bind_template_child_private (widget_class, GeditReplaceDialog, wrap_around_checkbutton);
}
......@@ -327,6 +329,10 @@ gedit_replace_dialog_init (GeditReplaceDialog *dlg)
dlg->priv->search_settings, "at-word-boundaries",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
g_object_bind_property (dlg->priv->regex_checkbutton, "active",
dlg->priv->search_settings, "regex-enabled",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
g_object_bind_property (dlg->priv->wrap_around_checkbutton, "active",
dlg->priv->search_settings, "wrap-around",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
......
......@@ -181,6 +181,23 @@
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="regex_checkbutton">
<property name="label" translatable="yes">Match as _regular expression</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="backwards_checkbutton">
<property name="label" translatable="yes">Search _backwards</property>
......@@ -195,7 +212,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
<property name="position">3</property>
</packing>
</child>
<child>
......@@ -213,7 +230,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
<property name="position">4</property>
</packing>
</child>
</object>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment