Skip to content

Commit

Permalink
fix(treesitter): de-duplicate langs in endure_installed. Fixes #628
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Apr 19, 2023
1 parent 0b8c799 commit 1d2c97c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lua/lazyvim/plugins/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ return {
},
---@param opts TSConfig
config = function(_, opts)
if type(opts.ensure_installed) == "table" then
---@type table<string, boolean>
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,
},
Expand Down

0 comments on commit 1d2c97c

Please sign in to comment.