From 07d7dd56b2adf7eb8a526cc10bd5373756ff58f2 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Sun, 5 Apr 2020 18:58:03 +0200 Subject: [PATCH] terminal: Add MULTILINE flag for regex To avoid _vte_regex_has_multiline_compile_flag warning. There is no exported constant to Python for setting the flag, so we use a local. --- terminatorlib/terminal.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 46ee6cd7..5aeeb6dc 100644 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -26,6 +26,11 @@ from .signalman import Signalman from . import plugin from terminatorlib.layoutlauncher import LayoutLauncher +# constant for vte matching +# TODO: Please replace with a proper reference to VTE, I found none! +PCRE2_MULTILINE = 0x00000400 + + # pylint: disable-msg=R0904 class Terminal(Gtk.VBox): """Class implementing the VTE widget and its wrappings""" @@ -142,7 +147,7 @@ class Terminal(Gtk.VBox): self.vte.show() self.default_encoding = self.vte.get_encoding() - self.regex_flags = Vte.REGEX_FLAGS_DEFAULT + self.regex_flags = (Vte.REGEX_FLAGS_DEFAULT | PCRE2_MULTILINE) self.update_url_matches() self.terminalbox = self.create_terminalbox()