Skip to content

Commit

Permalink
Merge pull request #249 from yoavp77/persist-search-case-sensitivity
Browse files Browse the repository at this point in the history
Preserve searchbar case sensitivity state in config file on state change
  • Loading branch information
mattrose authored Oct 19, 2020
2 parents 290ca4d + 19e1cf7 commit eef917b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions terminatorlib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
'putty_paste_style_source_clipboard': False,
'smart_copy' : True,
'line_height' : 1.0,
'case_sensitive' : True,
},
'keybindings': {
'zoom_in' : '<Control>plus',
Expand Down
4 changes: 3 additions & 1 deletion terminatorlib/searchbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def __init__(self):
self.match_case = Gtk.CheckButton.new_with_label('Match Case')
self.match_case.show()
self.match_case.set_sensitive(True)
self.match_case.set_active(True)
self.match_case.set_active(self.config.base.get_item('case_sensitive'))
self.match_case.connect('toggled', self.match_case_toggled)

# Wrap checkbox
Expand Down Expand Up @@ -132,6 +132,8 @@ def match_case_toggled(self, toggled):
self.regex_flags_pcre2 = regex.FLAGS_PCRE2
self.regex_flags_glib = regex.FLAGS_GLIB

self.config.base.set_item('case_sensitive', toggled_state)
self.config.save()
self.do_search(self.entry) # Start a new search everytime the check box is toggled.

def get_vte(self):
Expand Down

0 comments on commit eef917b

Please sign in to comment.