From 9386e876191b455d30a66dd97ecdb0e4dac4ef0f Mon Sep 17 00:00:00 2001 From: Sergei Slipchenko Date: Sat, 21 Mar 2026 10:17:30 +0400 Subject: [PATCH] fix: take into account a `nil` returned by `get_parser` Fixes #517 Related change in neovim: https://github.com/neovim/neovim/commit/fd1e019e90e76bb3f6236210ac6287f3b8d4d47f --- lua/Comment/ft.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/Comment/ft.lua b/lua/Comment/ft.lua index 34afffa..64a182a 100644 --- a/lua/Comment/ft.lua +++ b/lua/Comment/ft.lua @@ -293,7 +293,7 @@ end function ft.calculate(ctx) local ok, parser = pcall(vim.treesitter.get_parser, A.nvim_get_current_buf()) - if not ok then + if not ok or not parser then return ft.get(vim.bo.filetype, ctx.ctype) --[[ @as string ]] end