aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_defaults.lua
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua/vim/_defaults.lua')
-rw-r--r--runtime/lua/vim/_defaults.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/lua/vim/_defaults.lua b/runtime/lua/vim/_defaults.lua
index c709f0a308..dcf9b6ba70 100644
--- a/runtime/lua/vim/_defaults.lua
+++ b/runtime/lua/vim/_defaults.lua
@@ -9,17 +9,17 @@ do
end, { desc = 'Inspect highlights and extmarks at the cursor', bang = true })
vim.api.nvim_create_user_command('InspectTree', function(cmd)
+ local opts = { lang = cmd.fargs[1] }
+
if cmd.mods ~= '' or cmd.count ~= 0 then
local count = cmd.count ~= 0 and cmd.count or ''
local new = cmd.mods ~= '' and 'new' or 'vnew'
- vim.treesitter.inspect_tree({
- command = ('%s %s%s'):format(cmd.mods, count, new),
- })
- else
- vim.treesitter.inspect_tree()
+ opts.command = ('%s %s%s'):format(cmd.mods, count, new)
end
- end, { desc = 'Inspect treesitter language tree for buffer', count = true })
+
+ vim.treesitter.inspect_tree(opts)
+ end, { desc = 'Inspect treesitter language tree for buffer', count = true, nargs = '?' })
vim.api.nvim_create_user_command('EditQuery', function(cmd)
vim.treesitter.query.edit(cmd.fargs[1])