Skip to content

Commit

Permalink
fix(files): separator detection
Browse files Browse the repository at this point in the history
See #59
  • Loading branch information
rcarriga committed Sep 10, 2022
1 parent 3f8246e commit cf0fba8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lua/neotest/lib/file/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,18 @@ function M.parent(path)
return table.concat(elems, M.sep, 1, #elems - 1)
end

M.sep = vim.loop.os_uname().sysname == "Windows" and "\\" or "/"
M.sep = (function()
if jit then
local os = string.lower(jit.os)
if os == "linux" or os == "osx" or os == "bsd" then
return "/"
else
return "\\"
end
else
return package.config:sub(1, 1)
end
end)()

---@type fun(path: string): string
M.detect_filetype = fu.memoize(filetype.detect)
Expand Down

0 comments on commit cf0fba8

Please sign in to comment.