fix: gracefully handle new dirs with trailing backslash on windows (#336)

This commit is contained in:
Steven Arcangeli 2024-04-23 19:59:01 -07:00
parent 6a7a10b611
commit be0a1ecbf0

View file

@ -37,7 +37,7 @@ local FIELD_META = constants.FIELD_META
---@return string
---@return boolean
local function parsedir(name)
local isdir = vim.endswith(name, "/")
local isdir = vim.endswith(name, "/") or (fs.is_windows and vim.endswith(name, "\\"))
if isdir then
name = name:sub(1, name:len() - 1)
end