Skip to content

Commit

Permalink
Merge pull request #1769 from dadukhin/master
Browse files Browse the repository at this point in the history
Fix for search not working with vte 0.6+ (issue #1752)
  • Loading branch information
Davidy22 committed Sep 8, 2021
2 parents 459d559 + f2ae214 commit d88fc53
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
10 changes: 6 additions & 4 deletions guake/boxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from guake.callbacks import TerminalContextMenuCallbacks
from guake.dialogs import PromptResetColorsDialog
from guake.dialogs import RenameDialog
from guake.globals import PCRE2_MULTILINE
from guake.menus import mk_tab_context_menu
from guake.menus import mk_terminal_context_menu
from guake.utils import HidePrevention
Expand Down Expand Up @@ -363,7 +364,7 @@ def on_search_entry_keypress(self, widget, event):
self.search_prev = True

def reset_term_search(self, term):
term.search_set_gregex(GLib.Regex("", 0, 0), 0)
term.search_set_regex(None, 0)
term.search_find_next()

def set_search(self, widget):
Expand All @@ -378,9 +379,10 @@ def set_search(self, widget):

# Set search regex on term
self.searchstring = text
self.searchre = GLib.Regex(text, 0, 0)
term.search_set_gregex(self.searchre, 0)

self.searchre = Vte.Regex.new_for_search(
text, -1, Vte.REGEX_FLAGS_DEFAULT | PCRE2_MULTILINE
)
term.search_set_regex(self.searchre, 0)
self.do_search(None)

def do_search(self, widget):
Expand Down
4 changes: 4 additions & 0 deletions guake/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,7 @@ def is_run_from_git_workdir():

# Tabs session schema version
TABS_SESSION_SCHEMA_VERSION = 2

# Constants for vte regex matching are documented in the pcre2 api:
# https://www.pcre.org/current/doc/html/pcre2api.html
PCRE2_MULTILINE = 0x00000400
3 changes: 3 additions & 0 deletions releasenotes/notes/fix_search_vte0.46-b92145bc1e572521.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fixes:
- |
Update search box to work with updated regex vte apis for v0.46+, #1752

0 comments on commit d88fc53

Please sign in to comment.