fix: nvim_create_user_commands should have 3 args

master
Hung 2023-06-02 20:00:27 -07:00
parent 545a6a0d93
commit 60c3237a24
1 changed files with 3 additions and 2 deletions

View File

@ -221,12 +221,13 @@ function M.clear_highlights()
return M._delete_all_highlights(M.config, M.store) return M._delete_all_highlights(M.config, M.store)
end end
---@param config Config ---@param config Config | nil
function M.setup(config) function M.setup(config)
M.config = vim.tbl_deep_extend("force", M.config, config or M.config_default) M.config = vim.tbl_deep_extend("force", M.config, config or M.config_default)
M.config.nvim_ns = vim.api.nvim_create_namespace("tsql") M.config.nvim_ns = vim.api.nvim_create_namespace("tsql")
vim.api.nvim_create_user_command("Noh", M.clear_highlights, { nargs = "0", desc = "Clear tsql highlights" }) vim.api.nvim_create_user_command("Noh", function() M.clear_highlights() end,
{ nargs = "0", desc = "Clear tsql highlights" })
vim.api.nvim_create_user_command("Tdsl", function(cmd) vim.api.nvim_create_user_command("Tdsl", function(cmd)
M.s(cmd.args):do_nvim(M.store) M.s(cmd.args):do_nvim(M.store)
end, { nargs = "*", desc = "tsql DSL invocation" }) end, { nargs = "*", desc = "tsql DSL invocation" })