@@ -300,6 +300,7 @@ def load_plugins(self, force = False):
300
300
registry .load_plugins (force )
301
301
302
302
def _add_regex (self , name , re ):
303
+ dbg (f"adding regex: { re } " )
303
304
match = - 1
304
305
if regex .FLAGS_PCRE2 :
305
306
try :
@@ -323,19 +324,23 @@ def update_url_matches(self):
323
324
passchars = "-A-Za-z0-9,?;.:/!%$^*&~\" #'"
324
325
hostchars = r"-A-Za-z0-9:\[\]"
325
326
pathchars = "-A-Za-z0-9_$.+!*(),;:@&=?/~#%'"
326
- schemes = "(news:|telnet:|nntp:|file:/| https?:|ftps?:|webcal:|ssh:)"
327
+ schemes = "(news:|telnet:|nntp:|https?:|ftps?:|webcal:|ssh:)"
327
328
user = "[" + userchars + "]+(:[" + passchars + "]+)?"
328
329
urlpath = "/[" + pathchars + "]*[^]'.}>) \t \r \n ,\\ \" ]"
329
330
330
331
lboundry = "\\ b"
331
332
rboundry = "\\ b"
332
333
334
+ re = (lboundry + "file:/" + "//?(:[0-9]+)?(" + urlpath + ")" +
335
+ rboundry + "/?" )
336
+ self ._add_regex ('file' , re )
337
+
333
338
re = (lboundry + schemes +
334
339
"//(" + user + "@)?[" + hostchars + ".]+(:[0-9]+)?(" +
335
340
urlpath + ")?" + rboundry + "/?" )
336
341
self ._add_regex ('full_uri' , re )
337
342
338
- if self .matches ['full_uri' ] == - 1 :
343
+ if self .matches ['full_uri' ] == - 1 or self . matches [ 'file' ] == - 1 :
339
344
err ('Terminal::update_url_matches: Failed adding URL matches' )
340
345
else :
341
346
re = (lboundry +
0 commit comments