more fixes

This commit is contained in:
2025-04-23 00:15:13 -05:00
parent 254436c24d
commit c29395004d
6 changed files with 282 additions and 183 deletions

View File

@ -37,7 +37,7 @@ end
---@param opts vim.api.keyset.user_command? options
function lazy:cmd(name, opts)
opts = opts or {}
vim.api.nvim_create_user_command(name, function(o)
vim.api.nvim_create_user_command(name, opts['callback'] or function()
self:cleanup()
end, opts)
@ -49,9 +49,8 @@ end
---@param opts vim.api.keyset.create_autocmd? options
function lazy:auto(event, opts)
opts = opts or {}
opts['once'] = true
opts['callback'] = function()
opts['once'] = opts['once'] or true
opts['callback'] = opts['callback'] or function()
self:cleanup()
end
@ -64,7 +63,7 @@ end
---@param opts vim.keymap.set.Opts? options
function lazy:keymap(mode, bind, opts)
opts = opts or {}
vim.keymap.set(mode, bind, function()
vim.keymap.set(mode, bind, opts['callback'] or function()
self:cleanup()
-- register keymap unload