-
Notifications
You must be signed in to change notification settings - Fork 233
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
fix(filesystem): ignore dotfiles properly for find filter #1564
fix(filesystem): ignore dotfiles properly for find filter #1564
Conversation
Still an issue #1459, would be nice to move it forward |
Sorry, I can't properly evaluate this. See #1606 |
@@ -193,9 +193,6 @@ M.filter_files_external = function( | |||
if types.executable then | |||
append("-executable") | |||
end | |||
if not ignore.dotfiles then | |||
append("-not", "-path", "*/.*") | |||
end |
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 agree that it's obviously breaking but I don't know if it's necessarily redundant. Based on the code for fd
, the intention seems to be to optionally exclude hidden folders and hopefully reduce the amount of lines from the external cmd that neo-tree has to process?
To get the same functionality as the 'fd' block, could you try this instead? seems to work on my end:
-- right after `for k, v in pairs(types) do ... end`
if ignore.dotfiles then
append("-name", ".*", "-prune", "-o")
end
-- right before the call to append_find_args:
-- explicitly print out entries since `-prune -o` may expect an expression after it
append("-print")
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.
Indeed, I've tested with both enabled/disabled setting, works well so far
I've pushed the suggested improvement on top of the original fix, tested a few direct cases, didn't find any issues so far, so I think we good. |
Not sure what was the purpose of that exclusion, but it was causing issues when
find
command is used withinfilter
logic.You would expect that when
ignore-dotfiles
isfalse
you don't want to exclude dot files and directories. In fact it was not just excluding dot files, but all the other valid options if currentpath
contains any.
directories. For example for me the resulting command wasand because my path has
.config
-- all files were excluded, producing empty search result.Once this section removed, eveyrhing works as expected with both
ignore.dotfiles = true
andfalse
.