aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2023-03-02 10:01:42 -0500
committerGitHub <noreply@github.com>2023-03-02 07:01:42 -0800
commitb0b4c310973c2b419350e3c05c772596b1c334e9 (patch)
treea7d00324c860d9e5c55ae105785c9b103032dd73 /runtime/lua/vim
parenta0292b4e5f106482edc5623eef85aa48e2e55bb7 (diff)
downloadrneovim-b0b4c310973c2b419350e3c05c772596b1c334e9.tar.gz
rneovim-b0b4c310973c2b419350e3c05c772596b1c334e9.tar.bz2
rneovim-b0b4c310973c2b419350e3c05c772596b1c334e9.zip
refactor: rename show_tree => inspect_tree #22474
Problem: "show" is potentially a new verb that we can avoid (there is already "open" and "echo"). Even if we can't avoid it, the behavior of `show_tree` fits well in the "inspect" family of functions: a way for users to introspect/reflect on the state of Nvim. Existing "inspect" functions: vim.inspect() vim.inspect_pos() vim.treesitter.inspect_language() nvim__inspect_cell Solution: Rename `show_tree` to `inspect_tree`.
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r--runtime/lua/vim/treesitter.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/lua/vim/treesitter.lua b/runtime/lua/vim/treesitter.lua
index fead7b7b1b..412140b757 100644
--- a/runtime/lua/vim/treesitter.lua
+++ b/runtime/lua/vim/treesitter.lua
@@ -436,7 +436,7 @@ end
--- - 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.
-function M.show_tree(opts)
+function M.inspect_tree(opts)
vim.validate({
opts = { opts, 't', true },
})
@@ -622,6 +622,12 @@ function M.show_tree(opts)
})
end
+---@deprecated
+---@private
+function M.show_tree()
+ vim.deprecate('show_tree', 'inspect_tree', '0.9', nil, false)
+end
+
--- Returns the fold level for {lnum} in the current buffer. Can be set directly to 'foldexpr':
--- <pre>lua
--- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'