From 1d2c97cbda099c76ee132ee5019a3f80fd88f8ed Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 19 Apr 2023 16:44:57 +0200 Subject: [PATCH] fix(treesitter): de-duplicate langs in endure_installed. Fixes #628 --- lua/lazyvim/plugins/treesitter.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/lazyvim/plugins/treesitter.lua b/lua/lazyvim/plugins/treesitter.lua index 8aaea6ee..d1eeb191 100644 --- a/lua/lazyvim/plugins/treesitter.lua +++ b/lua/lazyvim/plugins/treesitter.lua @@ -67,6 +67,17 @@ return { }, ---@param opts TSConfig config = function(_, opts) + if type(opts.ensure_installed) == "table" then + ---@type table + local added = {} + opts.ensure_installed = vim.tbl_filter(function(lang) + if added[lang] then + return false + end + added[lang] = true + return true + end, opts.ensure_installed) + end require("nvim-treesitter.configs").setup(opts) end, },