feat(compat): added svim, a compatibility layer for Neovim. Closes #1321

This commit is contained in:
Folke Lemaitre 2025-02-20 06:56:47 +01:00
parent 7d10a38c44
commit bc902f7032
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
37 changed files with 133 additions and 90 deletions

View file

@ -107,7 +107,7 @@ end
---@param src string
function M.resolve(buf, src)
src = M.url_decode(src)
local file = vim.fs.normalize(vim.api.nvim_buf_get_name(buf))
local file = svim.fs.normalize(vim.api.nvim_buf_get_name(buf))
local s = Snacks.image.config.resolve and Snacks.image.config.resolve(file, src) or nil
if s then
return s
@ -130,7 +130,7 @@ function M.resolve(buf, src)
break
end
end
src = vim.fs.normalize(src)
src = svim.fs.normalize(src)
end
return src
end