mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-06 21:40:03 -04:00
configs: attach on unknown parsers too
This commit is contained in:
parent
1d178d75ea
commit
572a4a964b
3 changed files with 3 additions and 6 deletions
|
|
@ -113,6 +113,7 @@ function M.get_named_children(node)
|
|||
end
|
||||
|
||||
function M.get_node_at_cursor(winnr)
|
||||
if not parsers.has_parser() then return end
|
||||
local cursor = api.nvim_win_get_cursor(winnr or 0)
|
||||
local root = parsers.get_parser():parse():root()
|
||||
return root:named_descendant_for_range(cursor[1]-1,cursor[2],cursor[1]-1,cursor[2])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue