fix(dashboard): vim.pesc for auto keys. Fixes #134

This commit is contained in:
Folke Lemaitre 2024-11-21 19:10:37 +01:00
parent aa38175c00
commit aebffe535b
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -7,7 +7,7 @@ local M = setmetatable({}, {
})
local uv = vim.uv or vim.loop
math.randomseed(os.time())
math.randomseed()
---@class snacks.dashboard.Item
---@field indent? number
@ -628,7 +628,7 @@ function D:keys()
local autokeys = self.opts.autokeys:gsub("[hjklq]", "")
for _, item in ipairs(self.items) do
if item.key and not item.autokey then
autokeys = autokeys:gsub(item.key, "", 1)
autokeys = autokeys:gsub(vim.pesc(item.key), "", 1)
end
end
for _, item in ipairs(self.items) do
@ -1075,4 +1075,6 @@ function M.health()
end
end
M.Dashboard = D
return M