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

Incorrect matching on files with multiple dots #18

Closed
sandyarmstrong opened this issue May 7, 2015 · 3 comments
Closed

Incorrect matching on files with multiple dots #18

sandyarmstrong opened this issue May 7, 2015 · 3 comments

Comments

@sandyarmstrong
Copy link

If you have a file like "Company.Project.sln" or "archive.tar.gz", the highlighting and file name matching are incorrect. For example, fpp highlight and try to execute a command on "Project.sln" or "tar.gz".

@pcottle
Copy link
Contributor

pcottle commented May 8, 2015

Hey @sandyarmstrong

I can't seem to reproduce this -- we definitely allow multiple periods in the filename:

screen shot 2015-05-07 at 6 24 31 pm
screen shot 2015-05-07 at 6 24 39 pm

Can you perhaps provide some example input or a solid repro?

Note that we have separate regex for files that dont have a directory prepended to them (aka stuff like echo.py):
https://github.com/facebook/PathPicker/blob/master/src/parse.py#L30

but we have to be a lot more restrictive with that regex since we dont want to match JS code like:

data.object.some.field

(closing for now, reopen if you have the repro). a lot of this pain would go away if we simply checked if the file exists...

@sandyarmstrong
Copy link
Author

Your example only works because you provided an absolute path. It fails with relative paths. For example:

touch ~/banana.Project.sln
cd ~
echo banana.Project.sln | fpp
ls | fpp

Then you'll see the bad matching. I've tested with latest master.

@sandyarmstrong
Copy link
Author

Fixed in 3792357.

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

No branches or pull requests

2 participants