Skip to content

Commit

Permalink
fix(treesitter): upstream API changes. Fixes #962
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 2, 2024
1 parent 86c3ab0 commit 5070aae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/noice/text/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5070aae

Please sign in to comment.