diff --git a/lua/telescope/utils.lua b/lua/telescope/utils.lua index 44ab5d9b08..145b7f3aae 100644 --- a/lua/telescope/utils.lua +++ b/lua/telescope/utils.lua @@ -662,7 +662,11 @@ end) --- Checks if treesitter parser for language is installed ---@param lang string utils.has_ts_parser = function(lang) - return pcall(vim.treesitter.language.add, lang) + if vim.fn.has "nvim-0.11" == 1 then + return vim.treesitter.language.add(lang) + else + return pcall(vim.treesitter.language.add, lang) + end end --- Telescope Wrapper around vim.notify