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)
This commit is contained in:
kiyan
2022-03-03 23:56:29 +01:00
parent f6aba661ec
commit a3f256dc1b

View File

@@ -29,7 +29,7 @@ function M.fn(fname)
return i
end
local path_matches = node.nodes and utils.str_find(fname, node.absolute_path..utils.path_separator)
local path_matches = node.nodes and vim.startswith(fname, node.absolute_path..utils.path_separator)
if path_matches then
if not node.open then
node.open = true