fix(compat): fixes for Neovim < 0.10

This commit is contained in:
Folke Lemaitre 2024-12-11 23:20:28 +01:00
parent b13eaf6bd9
commit 33fbb309f8
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
5 changed files with 20 additions and 7 deletions

View file

@ -250,7 +250,7 @@ function M.open(opts)
return a[1] < b[1]
end)
for _, key in ipairs(ret.keys) do
local keymap = vim.fn.keytrans(vim.keycode(key[1]))
local keymap = vim.fn.keytrans(Snacks.util.keycode(key[1]))
table.insert(ret.opts.footer, { " " })
table.insert(ret.opts.footer, { " " .. keymap .. " ", "SnacksScratchKey" })
table.insert(ret.opts.footer, { " " .. (key.desc or keymap) .. " ", "SnacksScratchDesc" })