diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2023-02-22 08:01:08 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-22 08:01:08 -0700 |
commit | 675826da63e879efa97c0998fea192ed5c79d56e (patch) | |
tree | e21ae122150af334db50b43477f48a2f7811cbac /runtime/lua/vim/ui.lua | |
parent | 2281669470436a57f3bae746db05bb7b9ee4c171 (diff) | |
download | rneovim-675826da63e879efa97c0998fea192ed5c79d56e.tar.gz rneovim-675826da63e879efa97c0998fea192ed5c79d56e.tar.bz2 rneovim-675826da63e879efa97c0998fea192ed5c79d56e.zip |
refactor(treesitter): Add vim.treesitter.get_node() (#22360)
This function replaces both vim.treesitter.get_node_at_pos() and
vim.treesitter.get_node_at_cursor(). These two functions are similar
enough that they don't need separate interfaces. Even worse,
get_node_at_pos() returns a TSNode while get_node_at_cursor() returns a
string, so the two functions behave slightly differently.
vim.treesitter.get_node() combines these two into a more streamlined
interface. With no arguments, it returns the node under the cursor in
the current buffer. Optionally, it can accept a buffer number or a
position to get the node at a given position in a given buffer.
Diffstat (limited to 'runtime/lua/vim/ui.lua')
0 files changed, 0 insertions, 0 deletions