more fixes
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user