mirror of
https://github.com/chenasraf/vim-matchup.git
synced 2026-05-18 01:38:57 +00:00
Wrap TS parse in pcall to prevent crash
Fixes #201A.
This commit is contained in:
@@ -70,7 +70,10 @@ end
|
||||
|
||||
M.get_active_nodes = ts_utils.memoize_by_buf_tick(function(bufnr)
|
||||
-- TODO: why do we need to force a parse?
|
||||
parsers.get_parser():parse()
|
||||
if not pcall(function() parsers.get_parser():parse() end) then
|
||||
-- TODO workaround a crash due to tree-sitter parsing
|
||||
return {{ open={}, mid={}, close={} }, {}}
|
||||
end
|
||||
|
||||
local matches = M.get_matches(bufnr)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user