Skip to content

#618 filters.custom can specify regex #1112

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

Merged
merged 5 commits into from
Apr 2, 2022
Merged

Conversation

alex-courtis
Copy link
Member

closes #618

return true
end
pat = "^" .. pat .. "$"
if relpath:match(pat) or basename:match(pat) then
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use vim.regex if you prefer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it would be better indeed, lua regexes are not very common and harder to use than usual regexes :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sensible. Will change on weekend and update the doc.

@kyazdani42
Copy link
Member

also this does not close #618 , the feature request asks for the live-filter feature which i'm currently implementing :)

@kyazdani42 kyazdani42 merged commit 00fd8ae into master Apr 2, 2022
@mvllow
Copy link

mvllow commented Apr 6, 2022

This causes unexpected behaviour when trying to filter a specific file, eg. custom = { '.git' } now hides .github and .gitignore. Using .git$ works but not sure if that's the most obvious solution to most (I had to look it up). Seeing how this is already merged I don't expect any changes but maybe a note/example in the readme would be helpful 😌

If there is an appropriate page in the wiki for snippets or examples I'd be happy to edit that as well

@alex-courtis
Copy link
Member Author

If there is an appropriate page in the wiki for snippets or examples I'd be happy to edit that as well

I very briefly documented the option in the help however it could be clearer. A PR to update that would be great!

@kyazdani42 kyazdani42 deleted the #618-filters-custom-regex branch April 30, 2022 12:33
Almo7aya pushed a commit to Almo7aya/nvim-tree.lua that referenced this pull request Oct 11, 2022
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.

[Feature Request] Filtering by glob
3 participants