fix(explorer): windows path fixes

This commit is contained in:
Folke Lemaitre 2025-10-25 16:22:38 -07:00
parent aaeb55cbf5
commit e1dc6b3bdd
3 changed files with 3 additions and 2 deletions

View file

@ -26,7 +26,7 @@
local uv = vim.uv or vim.loop
local function norm(path)
return svim.fs.normalize(path)
return svim.fs.normalize(path):gsub("/$", "")
end
local function assert_dir(path)

View file

@ -82,7 +82,7 @@ function M.get(opts)
if opts.cwd == true or opts.cwd == "" then
opts.cwd = nil
elseif opts.cwd then
opts.cwd = svim.fs.normalize(vim.fn.fnamemodify(opts.cwd, ":p"))
opts.cwd = svim.fs.normalize(vim.fn.fnamemodify(opts.cwd:gsub("[\\/]?$", "/"), ":p"))
end
for _, t in ipairs(todo) do
if t.config then

View file

@ -87,6 +87,7 @@ function M.filename(item, picker)
if picker.opts.formatters.file.filename_only then
path = vim.fn.fnamemodify(item.file, ":t")
path = path == "" and item.file or path
ret[#ret + 1] = { path, base_hl, field = "file" }
else
ret[#ret + 1] = {