Skip to content

fix: windows gitignore #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/neo-tree/git/ignored.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions lua/neo-tree/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down