-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quick Open with dashes in /home/ paths #942
Conversation
@@ -74,8 +74,8 @@ | |||
r"^[-a-zA-Z0-9\/\_\.\ ]+\.?[a-zA-Z0-9]+\:[0-9]+", | |||
r"^(.*)\:([0-9]+)"), | |||
("line containing '/home/' absolute path", | |||
r"(/home/[a-zA-Z0-9_\-\./]+)(:[0-9]+)?", | |||
r"(/home/[a-zA-Z0-9_\-\./]+):?([0-9]+)?") | |||
r"(/home/[-a-zA-Z0-9_\./]+)(:[0-9]+)?", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you know why \-
does not work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, but I saw such behavior in different regexp for example in sed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked in pure python re, \-
works perfectly
It seems that regexp doesn't work in vte.Terminal.
I don't know what happens after vte.Terminal.match_add(match)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This page http://www.regular-expressions.info/charclass.html :
The closing bracket ], the caret ^ and the hyphen - can be included by escaping them with a backslash, or by placing them in a position where they do not take on their special meaning. The POSIX and GNU flavors are an exception. They treat backslashes in character classes as literal characters. So with these flavors, you can't escape anything in character classes.
looks like python-vte uses POSIX regex. If so, all backslashes inside []
lose their meaning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, quick open won't work with filenames with backslashes.
if you try to quick open this file:
$ echo "text" > 'some\file.txt'
$ echo 'some\file.txt:1'
command will be
DEBUG Opening file some\file.txt at line 1
where \f if is an escaped char.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
look like, thanks for this information !
QUICK_OPEN_MATCHERS line containing /home/