diff options
| author | Thomas Vigouroux <tomvig38@gmail.com> | 2020-07-27 13:38:09 +0200 |
|---|---|---|
| committer | Thomas Vigouroux <39092278+vigoux@users.noreply.github.com> | 2020-07-27 15:18:48 +0200 |
| commit | 572a4a964bbe4071c3c26c72d4259412761196fa (patch) | |
| tree | 406bec234a65675647360d2bad245020bf67c5f4 /lua/nvim-treesitter/ts_utils.lua | |
| parent | 1d178d75ea30a2e9ab0151867c7e1ededec22e03 (diff) | |
configs: attach on unknown parsers too
Diffstat (limited to 'lua/nvim-treesitter/ts_utils.lua')
| -rw-r--r-- | lua/nvim-treesitter/ts_utils.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/ts_utils.lua b/lua/nvim-treesitter/ts_utils.lua index fe110a7d..bf5b2208 100644 --- a/lua/nvim-treesitter/ts_utils.lua +++ b/lua/nvim-treesitter/ts_utils.lua @@ -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]) |
