Skip to content

Commit 61ec8cb

Browse files
authoredApr 5, 2017
Merge pull request Guake#929 from langpavel/home-quick-open
Add quick open possibility for lines containing `/home/`
2 parents 3e88d85 + 0d1be11 commit 61ec8cb

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed
 

‎src/guake/terminal.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@
7272
r"^\s\sFile\s\"(.*)\",\sline\s([0-9]+)"),
7373
("line starts by 'Filename:line' pattern (GCC/make). File path should exists.",
7474
r"^[a-zA-Z0-9\/\_\-\.\ ]+\.?[a-zA-Z0-9]+\:[0-9]+",
75-
r"^(.*)\:([0-9]+)")
75+
r"^(.*)\:([0-9]+)"),
76+
("line containing '/home/' absolute path",
77+
r"(/home/[a-zA-Z0-9_\-\./]+)(:[0-9]+)?",
78+
r"(/home/[a-zA-Z0-9_\-\./]+):?([0-9]+)?")
7679
]
7780

7881

@@ -162,10 +165,12 @@ def button_press(self, terminal, event):
162165
if use_quick_open:
163166
for _useless, _otheruseless, extractor in QUICK_OPEN_MATCHERS:
164167
g = re.compile(extractor).match(value)
165-
if g and len(g.groups()) == 2:
168+
if g and len(g.groups()) > 0:
166169
filename = g.group(1).strip()
167-
line_number = g.group(2)
168170
filepath = filename
171+
line_number = g.group(2)
172+
if line_number is None:
173+
line_number = "1"
169174
if not quick_open_in_current_terminal:
170175
curdir = self.get_current_directory()
171176
filepath = os.path.join(curdir, filename)

0 commit comments

Comments
 (0)
Please sign in to comment.