From 263f4b87434b4c33018bf1572a39fc4cf867a9d6 Mon Sep 17 00:00:00 2001 From: Till Bungert Date: Tue, 11 Apr 2023 13:40:52 +0200 Subject: [PATCH] fix(ft): use builtin to convert ft to parser lang Fixes #325. --- 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 1b7ecfbc..f84cc787 100644 --- a/lua/Comment/ft.lua +++ b/lua/Comment/ft.lua @@ -249,7 +249,7 @@ end function ft.calculate(ctx) local buf = A.nvim_get_current_buf() local filetype = vim.bo.filetype - local parsername = filetype_to_parsername[filetype] or filetype + local parsername = filetype_to_parsername[filetype] or vim.treesitter.language.get_lang(filetype) local ok, parser = pcall(vim.treesitter.get_parser, buf, parsername) if not ok then