From 81d9aadecf519de7b86cb19569d44176a3244584 Mon Sep 17 00:00:00 2001 From: lopy <70210066+lopi-py@users.noreply.github.com> Date: Sat, 26 Feb 2022 12:26:08 -0500 Subject: [PATCH 1/2] fix: check properly gitignore directories on windows --- lua/neo-tree/git/ignored.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/neo-tree/git/ignored.lua b/lua/neo-tree/git/ignored.lua index 05caab3b..77df3750 100644 --- a/lua/neo-tree/git/ignored.lua +++ b/lua/neo-tree/git/ignored.lua @@ -68,7 +68,7 @@ end M.is_ignored = function(ignored, path, _type) path = _type == "directory" and (path .. sep) or path for _, v in ipairs(ignored) do - if v:sub(-1) == utils.path_separator then + if v:sub(-1) == utils.path_separator or (utils.is_windows and _type == "directory") then -- directory ignore if vim.startswith(path, v) then return true From bf3d285d5910be34a2c0e01808a0f911dc4c2d6d Mon Sep 17 00:00:00 2001 From: lopy <70210066+lopi-py@users.noreply.github.com> Date: Sat, 26 Feb 2022 12:28:46 -0500 Subject: [PATCH 2/2] chore(utils.lua): remove duplicate definition of `M.path_separator` --- lua/neo-tree/utils.lua | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lua/neo-tree/utils.lua b/lua/neo-tree/utils.lua index bbcbd88a..881f0f43 100644 --- a/lua/neo-tree/utils.lua +++ b/lua/neo-tree/utils.lua @@ -347,13 +347,6 @@ M.resolve_config_option = function(state, config_option, default_value) end end ----The file system path separator for the current platform. -M.path_separator = "/" -M.is_windows = vim.fn.has("win32") == 1 or vim.fn.has("win32unix") == 1 -if M.is_windows == true then - M.path_separator = "\\" -end - ---Normalize a path, to avoid errors when comparing paths. ---@param path string The path to be normalize. ---@return string string The normalized path.