From 97f74ad2ceee77bd3742c630540411b2939e45b7 Mon Sep 17 00:00:00 2001 From: MaxST Date: Sun, 4 Aug 2019 01:54:48 +0300 Subject: [PATCH 1/4] Is this possibly useful? I made opportunity open a file in the current view from terminus for example Traceback python: ` Traceback (most recent call last): File "/home/user/.pyenv/versions/3.7.4/lib/python3.7/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/home/user/.pyenv/versions/3.7.4/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "client/__main__.py", line 13, in from module import settings ModuleNotFoundError: No module named 'module' ` --- terminus/mouse.py | 111 +++++++++++++++++++++++++++++++--------------- 1 file changed, 76 insertions(+), 35 deletions(-) diff --git a/terminus/mouse.py b/terminus/mouse.py index 30d6cb4..b36e28d 100644 --- a/terminus/mouse.py +++ b/terminus/mouse.py @@ -1,17 +1,18 @@ -import sublime -import sublime_plugin - -import re +# -*- coding: utf-8 -*- import logging +import re import webbrowser +from pathlib import Path + +import sublime +import sublime_plugin -from .terminal import Terminal, CONTINUATION +from .terminal import CONTINUATION, Terminal from .utils import highlight_key logger = logging.getLogger('Terminus') -rex = re.compile( - r'''(?x) +rex = re.compile(r'''(?x) \b(?: https?://(?:(?:[a-zA-Z0-9\-_]+(?:\.[a-zA-Z0-9\-._]+)+)|localhost)| # http:// www\.[a-zA-Z0-9\-_]+(?:\.[a-zA-Z0-9\-._]+)+ # www. @@ -19,6 +20,7 @@ /?[a-zA-Z0-9\-._?,!'(){}\[\]/+&@%$#=:"|~;]* # url path and query string [a-zA-Z0-9\-_~:/#@$*+=] # allowed end chars ''') +rexf = re.compile(r'(?i)(?:(?<=\"))(?P[a-zA-Z0-9\-_\./\\]+)(?:(?=\"))(?:\",)?(?:\sline\s)(?P[0-9]+)') URL_POPUP = """