fix(scratch): normalize filename

This commit is contained in:
Folke Lemaitre 2024-12-13 13:23:36 +01:00
parent 5532ba07be
commit 5200a8baa5
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -188,8 +188,9 @@ function M.open(opts)
vim.fn.mkdir(opts.root, "p")
local fname = Snacks.util.file_encode(table.concat(filekey, "|") .. "." .. ft)
file = vim.fs.normalize(opts.root .. "/" .. fname)
file = opts.root .. "/" .. fname
end
file = vim.fs.normalize(file)
local icon, icon_hl = unpack(type(opts.icon) == "table" and opts.icon or { opts.icon, nil })
---@cast icon string