From 5c93dfdfb315a2ddf9e63af48cc1a83d4de2f1b6 Mon Sep 17 00:00:00 2001 From: Calvin Bochulak Date: Wed, 22 May 2024 16:47:43 -0600 Subject: [PATCH] fix: wrap vim.treesitter.get_parser in pcall --- lua/nvim-ts-autotag/internal.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/nvim-ts-autotag/internal.lua b/lua/nvim-ts-autotag/internal.lua index adf479c..fd22124 100644 --- a/lua/nvim-ts-autotag/internal.lua +++ b/lua/nvim-ts-autotag/internal.lua @@ -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)