aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbadhi <bmadhikarinayake@gmail.com>2022-01-05 19:08:51 +0530
committerStephan Seitz <stephan.seitz@fau.de>2022-02-13 10:39:55 +0100
commit763e0e43f784332b0cd2918ead4efe547aeea843 (patch)
tree79ccad96c86eeea2fd4de58e98b153216bae1455
parentUpdate lockfile.json (#2517) (diff)
downloadnvim-treesitter-763e0e43f784332b0cd2918ead4efe547aeea843.tar
nvim-treesitter-763e0e43f784332b0cd2918ead4efe547aeea843.tar.gz
nvim-treesitter-763e0e43f784332b0cd2918ead4efe547aeea843.tar.bz2
nvim-treesitter-763e0e43f784332b0cd2918ead4efe547aeea843.tar.lz
nvim-treesitter-763e0e43f784332b0cd2918ead4efe547aeea843.tar.xz
nvim-treesitter-763e0e43f784332b0cd2918ead4efe547aeea843.tar.zst
nvim-treesitter-763e0e43f784332b0cd2918ead4efe547aeea843.zip
Added extra argument to setup commands so that user can change the function args types
-rw-r--r--lua/nvim-treesitter/utils.lua6
1 files changed, 4 insertions, 2 deletions
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 '<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!",