Skip to content

Commit

Permalink
fix: always use pcall to check for treesitter parser
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianHeinigk committed Oct 2, 2024
1 parent eae0d8f commit a7f5346
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lua/telescope/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -662,11 +662,7 @@ end)
--- Checks if treesitter parser for language is installed
---@param lang string
utils.has_ts_parser = function(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
return pcall(vim.treesitter.language.add, lang)
end

--- Telescope Wrapper around vim.notify
Expand Down

0 comments on commit a7f5346

Please sign in to comment.