diff --git a/lua/noice/text/treesitter.lua b/lua/noice/text/treesitter.lua index 4f83aa0..5826908 100644 --- a/lua/noice/text/treesitter.lua +++ b/lua/noice/text/treesitter.lua @@ -16,7 +16,11 @@ end function M.has_lang(lang) if vim.treesitter.language.get_lang then lang = vim.treesitter.language.get_lang(lang) or lang - return pcall(vim.treesitter.language.add, lang) + local ok, ret = pcall(vim.treesitter.language.add, lang) + if vim.fn.has("nvim-0.11") == 1 then + return ok and ret and true or false + end + return ok end ---@diagnostic disable-next-line: deprecated return vim.treesitter.language.require_language(lang, nil, true)