Skip to content

Commit

Permalink
fix(markdown): better check to see if a ts parser is available. Fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Mar 15, 2023
1 parent 4d2801b commit d60bee1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/noice/text/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ end

function M.has_lang(lang)
if vim.treesitter.language.get_lang then
return vim.treesitter.language.get_lang(lang) ~= nil
lang = vim.treesitter.language.get_lang(lang) or lang
return pcall(vim.treesitter.language.add, lang)
end
return vim.treesitter.language.require_language(lang, nil, true)
end
Expand Down

0 comments on commit d60bee1

Please sign in to comment.