Skip to content

Commit 498aae6

Browse files
authored
fix(git): handle gitignore for dirs in windows, fixes #158 (#159)
chore(utils.lua): remove duplicate definition of M.path_separator
1 parent 0df07cd commit 498aae6

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

lua/neo-tree/git/ignored.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ end
6868
M.is_ignored = function(ignored, path, _type)
6969
path = _type == "directory" and (path .. sep) or path
7070
for _, v in ipairs(ignored) do
71-
if v:sub(-1) == utils.path_separator then
71+
if v:sub(-1) == utils.path_separator or (utils.is_windows and _type == "directory") then
7272
-- directory ignore
7373
if vim.startswith(path, v) then
7474
return true

lua/neo-tree/utils.lua

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -347,13 +347,6 @@ M.resolve_config_option = function(state, config_option, default_value)
347347
end
348348
end
349349

350-
---The file system path separator for the current platform.
351-
M.path_separator = "/"
352-
M.is_windows = vim.fn.has("win32") == 1 or vim.fn.has("win32unix") == 1
353-
if M.is_windows == true then
354-
M.path_separator = "\\"
355-
end
356-
357350
---Normalize a path, to avoid errors when comparing paths.
358351
---@param path string The path to be normalize.
359352
---@return string string The normalized path.

0 commit comments

Comments
 (0)