aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/treesitter.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2022-09-25 00:45:15 +0200
committerJustin M. Keyes <justinkz@gmail.com>2022-09-25 13:46:15 +0200
commit3169fc54a129f6dd1c0baf2d404e50381cf48e8f (patch)
tree3d5d03ca2b37983b4f022e84dca1aed18ba84510 /runtime/lua/vim/treesitter.lua
parent2a3cb0893b03aeff4d8c0b2116cbddda53bba5a2 (diff)
downloadrneovim-3169fc54a129f6dd1c0baf2d404e50381cf48e8f.tar.gz
rneovim-3169fc54a129f6dd1c0baf2d404e50381cf48e8f.tar.bz2
rneovim-3169fc54a129f6dd1c0baf2d404e50381cf48e8f.zip
refactor(treesitter): rename x_position => x_pos
"pos" has a long precedent as "position" in vim, and there is no reason to use a verbose name here.
Diffstat (limited to 'runtime/lua/vim/treesitter.lua')
-rw-r--r--runtime/lua/vim/treesitter.lua9
1 files changed, 4 insertions, 5 deletions
diff --git a/runtime/lua/vim/treesitter.lua b/runtime/lua/vim/treesitter.lua
index 04e12cbe0b..6cd00516bf 100644
--- a/runtime/lua/vim/treesitter.lua
+++ b/runtime/lua/vim/treesitter.lua
@@ -202,7 +202,7 @@ end
---@param col number Position column
---
---@return table[] List of captures `{ capture = "capture name", metadata = { ... } }`
-function M.get_captures_at_position(bufnr, row, col)
+function M.get_captures_at_pos(bufnr, row, col)
if bufnr == 0 then
bufnr = a.nvim_get_current_buf()
end
@@ -258,7 +258,7 @@ function M.get_captures_at_cursor(winnr)
local bufnr = a.nvim_win_get_buf(winnr)
local cursor = a.nvim_win_get_cursor(winnr)
- local data = M.get_captures_at_position(bufnr, cursor[1] - 1, cursor[2])
+ local data = M.get_captures_at_pos(bufnr, cursor[1] - 1, cursor[2])
local captures = {}
@@ -278,7 +278,7 @@ end
--- - ignore_injections boolean Ignore injected languages (default true)
---
---@return userdata |tsnode| under the cursor
-function M.get_node_at_position(bufnr, row, col, opts)
+function M.get_node_at_pos(bufnr, row, col, opts)
if bufnr == 0 then
bufnr = a.nvim_get_current_buf()
end
@@ -302,8 +302,7 @@ function M.get_node_at_cursor(winnr)
local bufnr = a.nvim_win_get_buf(winnr)
local cursor = a.nvim_win_get_cursor(winnr)
- return M.get_node_at_position(bufnr, cursor[1] - 1, cursor[2], { ignore_injections = false })
- :type()
+ return M.get_node_at_pos(bufnr, cursor[1] - 1, cursor[2], { ignore_injections = false }):type()
end
--- Starts treesitter highlighting for a buffer