From 18783cb9ce4f44352d8911f0df45523414312903 Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Wed, 2 Dec 2015 14:36:18 +0100 Subject: [PATCH] Remove the now unused posix regex code, and set the regex boundary vars to the correct '\b' value --- terminatorlib/config.py | 1 - terminatorlib/terminal.py | 28 +++++----------------------- 2 files changed, 5 insertions(+), 24 deletions(-) diff --git a/terminatorlib/config.py b/terminatorlib/config.py index 0c74173c..59d84ed8 100755 --- a/terminatorlib/config.py +++ b/terminatorlib/config.py @@ -104,7 +104,6 @@ DEFAULTS = { 'always_on_top' : False, 'hide_on_lose_focus' : False, 'sticky' : False, - 'try_posix_regexp' : platform.system() != 'Linux', 'use_custom_url_handler': False, 'custom_url_handler' : '', 'disable_real_transparency' : False, diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index e4ae8d4b..e9f6b41d 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -142,7 +142,7 @@ class Terminal(Gtk.VBox): self.vte.show() self.default_encoding = self.vte.get_encoding() - self.update_url_matches(self.config['try_posix_regexp']) + self.update_url_matches() self.terminalbox = self.create_terminalbox() @@ -257,7 +257,7 @@ class Terminal(Gtk.VBox): return(terminalbox) - def update_url_matches(self, posix = True): + def update_url_matches(self): """Update the regexps used to match URLs""" userchars = "-A-Za-z0-9" passchars = "-A-Za-z0-9,?;.:/!%$^*&~\"#'" @@ -267,22 +267,8 @@ class Terminal(Gtk.VBox): user = "[" + userchars + "]+(:[" + passchars + "]+)?" urlpath = "/[" + pathchars + "]*[^]'.}>) \t\r\n,\\\"]" - if posix: - dbg ('Terminal::update_url_matches: Trying POSIX URL regexps') - lboundry = "[[:<:]]" - rboundry = "[[:>:]]" - else: # GNU - dbg ('Terminal::update_url_matches: Trying GNU URL regexps') - lboundry = "\\<" - rboundry = "\\>" - - # VERIFY/FIXME FOR GTK3: What's this with the POSIX and GNU mode l/r boundry[sic] values? - # Neither of the two works for me since the Vte 0.38 update. - # Should we get rid of them and the try_posix_regexp option totally? - # They don't seem to be necessary, and there really shouldn't be any difference - # between Linux and non-Linux systems, GLib should hide this (does it?). - lboundry = '' - rboundry = '' + lboundry = "\\b" + rboundry = "\\b" re = (lboundry + schemes + "//(" + user + "@)?[" + hostchars +".]+(:[0-9]+)?(" + @@ -291,11 +277,7 @@ class Terminal(Gtk.VBox): self.matches['full_uri'] = self.vte.match_add_gregex(reg, 0) if self.matches['full_uri'] == -1: - if posix: - err ('Terminal::update_url_matches: POSIX failed, trying GNU') - self.update_url_matches(posix = False) - else: - err ('Terminal::update_url_matches: Failed adding URL matches') + err ('Terminal::update_url_matches: Failed adding URL matches') else: re = (lboundry + '(callto:|h323:|sip:)' + "[" + userchars + "+][" +