Skip to content

Commit 02b9376

Browse files
committed
feat(view): filters.no_buffer matches directories specifically
1 parent f7de34e commit 02b9376

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lua/nvim-tree/explorer/filters.lua

+1-3
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,10 @@ function M.should_ignore(path, bufinfo, unloaded_bufnr)
2727
return false
2828
end
2929

30-
-- TODO exact match for files, ../ for dirs
31-
3230
-- filter files with no open buffer and directories containing no open buffers
3331
if M.config.filter_no_buffer and type(bufinfo) == "table" then
3432
for _, buf in ipairs(bufinfo) do
35-
if buf.name:find(path, 1, true) and buf.bufnr ~= unloaded_bufnr then
33+
if buf.name == path or buf.name:find(path .. "/", 1, true) and buf.bufnr ~= unloaded_bufnr then
3634
return false
3735
end
3836
end

0 commit comments

Comments
 (0)