From 763e0e43f784332b0cd2918ead4efe547aeea843 Mon Sep 17 00:00:00 2001 From: badhi Date: Wed, 5 Jan 2022 19:08:51 +0530 Subject: Added extra argument to setup commands so that user can change the function args types --- lua/nvim-treesitter/utils.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lua') diff --git a/lua/nvim-treesitter/utils.lua b/lua/nvim-treesitter/utils.lua index b828d28a1..235ec4570 100644 --- a/lua/nvim-treesitter/utils.lua +++ b/lua/nvim-treesitter/utils.lua @@ -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 '' local call_fn = string.format( - "lua require'nvim-treesitter.%s'.commands.%s['run']()", + "lua require'nvim-treesitter.%s'.commands.%s['run'](%s)", mod, - command_name + command_name, + f_args ) local parts = vim.tbl_flatten { "command!", -- cgit v1.2.3-70-g09d2