Skip to content

Commit

Permalink
Merge pull request #110 from mattrose/add-debug-to-searchbar
Browse files Browse the repository at this point in the history
add debug logging to searchbar
  • Loading branch information
mattrose authored Jun 2, 2020
2 parents 3f20a8a + 31eb79b commit aefaad7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions terminatorlib/searchbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from .translation import _
from .config import Config
from . import regex
from .util import dbg

# pylint: disable-msg=R0904
class Searchbar(Gtk.HBox):
Expand Down Expand Up @@ -125,7 +126,9 @@ def start_search(self):

def do_search(self, widget):
"""Trap and re-emit the clicked signal"""
dbg('entered do_search')
searchtext = self.entry.get_text()
dbg('searchtext: %s' % searchtext)
if searchtext == '':
return

Expand All @@ -136,6 +139,7 @@ def do_search(self, widget):
if regex.FLAGS_PCRE2:
try:
self.searchre = Vte.Regex.new_for_search(searchtext, len(searchtext), regex.FLAGS_PCRE2)
dbg('search RE: %s' % self.searchre)
self.vte.search_set_regex(self.searchre, 0)
except GLib.Error:
# happens when PCRE2 support is not builtin (Ubuntu < 19.10)
Expand All @@ -144,6 +148,7 @@ def do_search(self, widget):
if not self.searchre:
# fall back to old GLib regex
self.searchre = GLib.Regex(searchtext, regex.FLAGS_GLIB, 0)
dbg('search RE: %s' % self.searchre)
self.vte.search_set_gregex(self.searchre, 0)

self.next.set_sensitive(True)
Expand Down

0 comments on commit aefaad7

Please sign in to comment.