Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions data/io.elementary.code.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
<value nick="For Selection" value="1" />
<value nick="Always" value="2" />
</enum>
<enum id="io.elementary.code.case-sensitive-mode">
<value nick="never" value="0" />
<value nick="mixed" value="1" />
<value nick="always" value="2" />
</enum>

<schema path="/io/elementary/code/saved-state/" id="io.elementary.code.saved-state" gettext-domain="io.elementary.code">
<key name="window-state" enum="io.elementary.code.window-states">
Expand Down Expand Up @@ -155,6 +160,21 @@
<summary>Whether search is cyclic</summary>
<description>Whether text searching should cycle back to the beginning of the document after reaching the end of the document.</description>
</key>
<key name="wholeword-search" type="b">
<default>false</default>
<summary>Whether search is for whole words</summary>
<description>Whether the search should only match whole words.</description>
</key>
<key name="regex-search" type="b">
<default>false</default>
<summary>Whether search term is a regex expression</summary>
<description>Whether the search should use the search term as a regex expression for matching.</description>
</key>
<key name="case-sensitive-search" enum="io.elementary.code.case-sensitive-mode">
<default>'mixed'</default>
<summary>When text search is case sensitive</summary>
<description>Whether the text search is case sensitive never, always or only when search term is mixed case</description>
</key>
<key name="strip-trailing-on-save" type="b">
<default>false</default>
<summary>Whether to automatically remove trailing whitespace on saving</summary>
Expand Down
9 changes: 6 additions & 3 deletions src/Widgets/SearchBar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ namespace Scratch.Widgets {
cycle_search_button = new Granite.SwitchModelButton (_("Cyclic Search"));

case_sensitive_search_button = new Gtk.ComboBoxText ();
case_sensitive_search_button.append (null, _("Never"));
case_sensitive_search_button.append (null, _("Mixed Case"));
case_sensitive_search_button.append (null, _("Always"));
case_sensitive_search_button.append ("never", _("Never"));
case_sensitive_search_button.append ("mixed", _("Mixed Case"));
case_sensitive_search_button.append ("always", _("Always"));
case_sensitive_search_button.active = 1;

var case_sensitive_search_label = new Gtk.Label (_("Case Sensitive"));
Expand Down Expand Up @@ -143,6 +143,9 @@ namespace Scratch.Widgets {
regex_search_button.toggled.connect (on_search_entry_text_changed);

Scratch.settings.bind ("cyclic-search", cycle_search_button, "active", SettingsBindFlags.DEFAULT);
Scratch.settings.bind ("wholeword-search", whole_word_search_button, "active", SettingsBindFlags.DEFAULT);
Scratch.settings.bind ("regex-search", regex_search_button, "active", SettingsBindFlags.DEFAULT);
Scratch.settings.bind ("case-sensitive-search", case_sensitive_search_button, "active-id", SettingsBindFlags.DEFAULT);

var search_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0) {
margin_top = 3,
Expand Down