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

Improving inverted match #13

Open
matteobrusa opened this issue May 13, 2016 · 5 comments
Open

Improving inverted match #13

matteobrusa opened this issue May 13, 2016 · 5 comments

Comments

@matteobrusa
Copy link

I'd like to show only .jpg (or .JPG) files in a multilevel directory tree.
Unfortunately, from what I understand it's not currently possible to match dirs specifically.

What if dirs were matched with a trailing slash, as in:

# /file1.flac
# /file1.mp3
# /file2.mp3
# /subDir1/                <-- trailing slash
# /subDir1/file3.flac

This way it would be easy to create a regex to match jpgs or folders.
What do you think of this?

@gburca
Copy link
Owner

gburca commented May 16, 2016

That's a good idea. You can submit a patch.

@layus
Copy link
Contributor

layus commented Aug 4, 2016

to match dirs, I used ^\/subDir1(\/|$) (escaped).
This allows to access the dir directly, and sub-elements.

Not sure it is completely correct, but it worked for me.

@fulldecent
Copy link
Contributor

I believe this ^^ directory-matching technique solves the problem

@gburca
Copy link
Owner

gburca commented Dec 17, 2016

That works, but it also matches files that are called "subDir1".

@kalvdans
Copy link

I've made a patch that appends a slash when matching directories in #31. It will however break existing filters, please suggest how to make it backwards-compatible? The other option that would work for me (since I want to allow all directories) is to add DIR to the list of filetypes to match: |type:DIR

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

5 participants