From 2720d2c793b22e6c0c8719e5592922619fffdf7a Mon Sep 17 00:00:00 2001 From: Yochem van Rosmalen Date: Fri, 17 Mar 2023 12:41:57 +0100 Subject: fix(treesitter): InspectTree does not respect 'splitright' #22692 Problem: vim.treesitter.inspect_tree() and :InspectTree does not respect 'splitright'. Solution: - Change the default `command` from `topleft 60vnew` to `60vnew`. - Change :InspectTree to respect command mods (`:vertical`, count, etc.). Closes #22656 --- runtime/lua/vim/treesitter.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/treesitter.lua b/runtime/lua/vim/treesitter.lua index 56000f99a8..43b8c11b80 100644 --- a/runtime/lua/vim/treesitter.lua +++ b/runtime/lua/vim/treesitter.lua @@ -439,7 +439,7 @@ end --- - winid (integer|nil): Window id to display the tree buffer in. If omitted, --- a new window is created with {command}. --- - command (string|nil): Vimscript command to create the window. Default ---- value is "topleft 60vnew". Only used when {winid} is nil. +--- value is "60vnew". Only used when {winid} is nil. --- - title (string|fun(bufnr:integer):string|nil): Title of the window. If a --- function, it accepts the buffer number of the source buffer as its only --- argument and should return a string. @@ -465,7 +465,7 @@ function M.inspect_tree(opts) local w = opts.winid if not w then - vim.cmd(opts.command or 'topleft 60vnew') + vim.cmd(opts.command or '60vnew') w = a.nvim_get_current_win() end -- cgit