mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-22 04:21:08 +00:00
fix(treesitter-main): move exe check to config
This commit is contained in:
parent
44ade7fdea
commit
96316e5a69
1 changed files with 4 additions and 7 deletions
|
|
@ -6,16 +6,13 @@ return {
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
cmd = { "TSUpdate", "TSInstall", "TSLog", "TSUninstall" },
|
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,
|
init = function() end,
|
||||||
---@param opts TSConfig
|
---@param opts TSConfig
|
||||||
config = function(_, opts)
|
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
|
if type(opts.ensure_installed) ~= "table" then
|
||||||
error("opts.ensure_installed must be a table")
|
error("opts.ensure_installed must be a table")
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue