fix: wrap vim.treesitter.get_parser in pcall

This commit is contained in:
Calvin Bochulak 2024-05-22 16:47:43 -06:00
parent 62db4b3054
commit 5c93dfdfb3
No known key found for this signature in database
GPG Key ID: 49927EF8F85114FB

View File

@ -430,8 +430,8 @@ local is_before_arrow = is_before("<", 0)
M.rename_tag = function()
if is_before_word() then
local parser = vim.treesitter.get_parser()
if not parser then
local ok, parser = pcall(vim.treesitter.get_parser)
if not ok then
return
end
parser:parse(true)