Skip to content
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

Merged
merged 1 commit into from
Apr 24, 2017
Merged

Quick Open with dashes in /home/ paths #942

merged 1 commit into from
Apr 24, 2017

Conversation

denis-gonzo
Copy link
Contributor

QUICK_OPEN_MATCHERS line containing /home/

@@ -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]+)?",
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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)

Copy link
Contributor Author

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

Copy link
Contributor Author

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.

Copy link
Member

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 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants