Skip to content

Commit f7801ec

Browse files
authored
fix(filesystem): ignore dotfiles properly for find filter (#1564)
Closes #1459 Co-authored-by: Artem Obukhov <[email protected]>
1 parent d175a0c commit f7801ec

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lua/neo-tree/sources/filesystem/lib/filter_external.lua

+4-3
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ M.filter_files_external = function(
184184
file_types[#file_types + 1] = file_type_map[k]
185185
end
186186
end
187+
if ignore.dotfiles then
188+
append("-name", ".*", "-prune", "-o")
189+
end
187190
if #file_types > 0 then
188191
append("-type", table.concat(file_types, ","))
189192
end
@@ -193,9 +196,6 @@ M.filter_files_external = function(
193196
if types.executable then
194197
append("-executable")
195198
end
196-
if not ignore.dotfiles then
197-
append("-not", "-path", "*/.*")
198-
end
199199
if glob ~= nil and not full_path then
200200
append("-iname", glob)
201201
elseif glob ~= nil and full_path then
@@ -205,6 +205,7 @@ M.filter_files_external = function(
205205
elseif regex ~= nil then
206206
append("-regextype", "sed", "-regex", regex)
207207
end
208+
append("-print")
208209
append_find_args()
209210
elseif cmd == "fzf" then
210211
-- This does not work yet, there's some kind of issue with how fzf uses stdout

0 commit comments

Comments
 (0)