configs: attach on unknown parsers too

This commit is contained in:
Thomas Vigouroux 2020-07-27 13:38:09 +02:00 committed by Thomas Vigouroux
parent 1d178d75ea
commit 572a4a964b
3 changed files with 3 additions and 6 deletions

View file

@ -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])