fix(treesitter-main): move exe check to config

This commit is contained in:
Folke Lemaitre
2025-09-15 17:17:21 +02:00
parent 44ade7fdea
commit 96316e5a69

View File

@@ -6,16 +6,13 @@ return {
build = ":TSUpdate",
lazy = true,
cmd = { "TSUpdate", "TSInstall", "TSLog", "TSUninstall" },
enabled = function()
if vim.fn.executable("tree-sitter") == 0 then
LazyVim.error("**treesitter-main** requires the `tree-sitter` executable to be installed")
return false
end
return true
end,
init = function() end,
---@param opts TSConfig
config = function(_, opts)
if vim.fn.executable("tree-sitter") == 0 then
LazyVim.error("**treesitter-main** requires the `tree-sitter` executable to be installed")
return
end
if type(opts.ensure_installed) ~= "table" then
error("opts.ensure_installed must be a table")
end