Skip to content

Commit a3f256d

Browse files
committed
fix(find-file): match folders with prefix, not containing the node
avoid opening folders matching part of the string (/dev matching /home/dev for instance)
1 parent f6aba66 commit a3f256d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/nvim-tree/actions/find-file.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function M.fn(fname)
2929
return i
3030
end
3131

32-
local path_matches = node.nodes and utils.str_find(fname, node.absolute_path..utils.path_separator)
32+
local path_matches = node.nodes and vim.startswith(fname, node.absolute_path..utils.path_separator)
3333
if path_matches then
3434
if not node.open then
3535
node.open = true

0 commit comments

Comments
 (0)