mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-05 19:28:24 +00:00
fix(dashboard): vim.pesc
for auto keys. Fixes #134
This commit is contained in:
parent
aa38175c00
commit
aebffe535b
1 changed files with 4 additions and 2 deletions
|
@ -7,7 +7,7 @@ local M = setmetatable({}, {
|
||||||
})
|
})
|
||||||
|
|
||||||
local uv = vim.uv or vim.loop
|
local uv = vim.uv or vim.loop
|
||||||
math.randomseed(os.time())
|
math.randomseed()
|
||||||
|
|
||||||
---@class snacks.dashboard.Item
|
---@class snacks.dashboard.Item
|
||||||
---@field indent? number
|
---@field indent? number
|
||||||
|
@ -628,7 +628,7 @@ function D:keys()
|
||||||
local autokeys = self.opts.autokeys:gsub("[hjklq]", "")
|
local autokeys = self.opts.autokeys:gsub("[hjklq]", "")
|
||||||
for _, item in ipairs(self.items) do
|
for _, item in ipairs(self.items) do
|
||||||
if item.key and not item.autokey then
|
if item.key and not item.autokey then
|
||||||
autokeys = autokeys:gsub(item.key, "", 1)
|
autokeys = autokeys:gsub(vim.pesc(item.key), "", 1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
for _, item in ipairs(self.items) do
|
for _, item in ipairs(self.items) do
|
||||||
|
@ -1075,4 +1075,6 @@ function M.health()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
M.Dashboard = D
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue