revert "fix(config)!: always install parsers bundled with nvim"

This commit is contained in:
Christian Clason 2024-01-19 16:45:58 +01:00
parent 090880c0f1
commit f197a15b0d

View file

@ -20,7 +20,7 @@ local M = {}
local config = {
modules = {},
sync_install = false,
ensure_installed = { "lua", "query", "vimdoc", "vim", "c", "python", "bash", "markdown", "markdown_inline" },
ensure_installed = {},
auto_install = false,
ignore_install = {},
parser_install_dir = nil,
@ -405,18 +405,6 @@ function M.is_enabled(mod, lang, bufnr)
return true
end
---Combine two list-like tables without duplicates
local union = function(x, y)
local map = {}
for _, v in ipairs(x) do
map[v] = true
end
for _, v in ipairs(y) do
map[v] = true
end
return vim.tbl_keys(map)
end
---Setup call for users to override module configurations.
---@param user_data TSConfig module overrides
function M.setup(user_data)
@ -432,10 +420,7 @@ function M.setup(user_data)
require("nvim-treesitter.install").setup_auto_install()
end
local ensure_installed = user_data.ensure_installed or config.ensure_installed
if type(ensure_installed) == "table" and type(config.ensure_installed) == "table" then
union(ensure_installed, config.ensure_installed)
end
local ensure_installed = user_data.ensure_installed or {}
if #ensure_installed > 0 then
if user_data.sync_install then
require("nvim-treesitter.install").ensure_installed_sync(ensure_installed)