mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-03 03:56:52 -04:00
Added extra argument to setup commands so that user can change the function args types
This commit is contained in:
parent
a13b40248a
commit
763e0e43f7
1 changed files with 4 additions and 2 deletions
|
|
@ -12,10 +12,12 @@ end
|
|||
|
||||
function M.setup_commands(mod, commands)
|
||||
for command_name, def in pairs(commands) do
|
||||
local f_args = def.f_args or '<f-args>'
|
||||
local call_fn = string.format(
|
||||
"lua require'nvim-treesitter.%s'.commands.%s['run<bang>'](<f-args>)",
|
||||
"lua require'nvim-treesitter.%s'.commands.%s['run<bang>'](%s)",
|
||||
mod,
|
||||
command_name
|
||||
command_name,
|
||||
f_args
|
||||
)
|
||||
local parts = vim.tbl_flatten {
|
||||
"command!",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue