From 660344a8b71098b706b93e4218d8b5ea82d3ba39 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Tue, 8 Apr 2008 00:22:01 +0100 Subject: [PATCH] fall back to old regexps if the freebsd ones don't work --- terminator | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/terminator b/terminator index 45d60ad1..7706e56d 100755 --- a/terminator +++ b/terminator @@ -137,11 +137,20 @@ class TerminatorTerm: self._vte.connect ("enter_notify_event", self.on_vte_notify_enter) self.matches['full_uri'] = self._vte.match_add ('''[[:<:]](news:|telnet:|nntp:|file:/|https?:|ftps?:|webcal:)//([-A-Za-z0-9]+(:[-A-Za-z0-9,?;.:/!%$^*&~"#']+)?@)?[-A-Za-z0-9.]+(:[0-9]+)?(/[-A-Za-z0-9_$.+!*(),;:@&=?/~#%]*[^]'.}>) \t\r\n,\"])?[[:>:]]/?''') + if self.matches['full_uri'] == -1: + self.matches['full_uri'] = self._vte.match_add ('''\<(news:|telnet:|nntp:|file:/|https?:|ftps?:|webcal:)//([-A-Za-z0-9]+(:[-A-Za-z0-9,?;.:/!%$^*&~"#']+)?@)?[-A-Za-z0-9.]+(:[0-9]+)?(/[-A-Za-z0-9_$.+!*(),;:@&=?/~#%]*[^]'.}>) \t\r\n,\"])?\>/?''') + self.matches['addr_only'] = self._vte.match_add ('''[[:<:]](www|ftp)[-A-Za-z0-9]*\.[-A-Za-z0-9.]+(:[0-9]+)?(/[-A-Za-z0-9_$.+!*(),;:@&=?/~#%]*[^]'.}>) \t\r\n,\"])?[[:>:]]/?''') + if self.matches['addr_only'] == -1: + self.matches['addr_only'] = self._vte.match_add ('''\<(www|ftp)[-A-Za-z0-9]*\.[-A-Za-z0-9.]+(:[0-9]+)?(/[-A-Za-z0-9_$.+!*(),;:@&=?/~#%]*[^]'.}>) \t\r\n,\"])?\>/?''') self.matches['email'] = self._vte.match_add ('''[[:<:]](mailto:)?[a-z0-9][a-z0-9.-]*@[a-z0-9][a-z0-9-]*(\.[a-z0-9][a-z0-9-]*)+[[:>:]]''') + if self.matches['email'] == -1: + self.matches['email'] = self._vte.match_add ('''\<(mailto:)?[a-z0-9][a-z0-9.-]*@[a-z0-9][a-z0-9-]*(\.[a-z0-9][a-z0-9-]*)+\>''') self.matches['nntp'] = self._vte.match_add ('''[[:<:]]news:[-A-Z\^_a-z{|}~!"#$%&'()*+,./0-9;:=?`]+@[-A-Za-z0-9.]+(:[0-9]+)?[[:>:]]''') + if self.matches['nntp'] == -1: + self.matches['nntp'] = self._vte.match_add ('''\''') self.spawn_child () @@ -381,7 +390,7 @@ class TerminatorTerm: def zoom (self, zoom_in): pangodesc = self._vte.get_font () - fontsize = pangodesc.get_size () + fontsize = pangodesc.get_size () if fontsize > pango.SCALE and not zoom_in: fontsize -= pango.SCALE