From a3f256dc1b1273707e70ee23e6e19ca527710732 Mon Sep 17 00:00:00 2001 From: kiyan Date: Thu, 3 Mar 2022 23:56:29 +0100 Subject: [PATCH] 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) --- lua/nvim-tree/actions/find-file.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/nvim-tree/actions/find-file.lua b/lua/nvim-tree/actions/find-file.lua index 42ed17a4..cdfb28f4 100644 --- a/lua/nvim-tree/actions/find-file.lua +++ b/lua/nvim-tree/actions/find-file.lua @@ -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