mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 11:36:54 -04:00
Fix: Account for winnr being nil in calls to get_node_at_cursor
This commit is contained in:
parent
9a7301de4c
commit
35c99feae5
1 changed files with 2 additions and 1 deletions
|
|
@ -122,7 +122,8 @@ function M.get_named_children(node)
|
|||
end
|
||||
|
||||
function M.get_node_at_cursor(winnr)
|
||||
local cursor = api.nvim_win_get_cursor(winnr or 0)
|
||||
winnr = winnr or 0
|
||||
local cursor = api.nvim_win_get_cursor(winnr)
|
||||
local cursor_range = { cursor[1] - 1, cursor[2] }
|
||||
|
||||
local buf = vim.api.nvim_win_get_buf(winnr)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue