fix(help): get rid of any tbl_flatten or iter flatten code

This commit is contained in:
Folke Lemaitre 2024-05-19 17:29:43 +02:00
parent 5d29ffeaa0
commit 56a34a825b
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 4 additions and 5 deletions

View File

@ -8,12 +8,11 @@ function M.index(plugin)
return {} return {}
end end
---@param file string local files = {}
local tbl = vim.tbl_map(function(file)
return vim.fn.expand(plugin.dir .. "/" .. file, false, true)
end, Config.options.readme.files)
local files = vim.iter and vim.iter(tbl):flatten():totable() or vim.tbl_flatten(tbl) for _, file in ipairs(Config.options.readme.files) do
vim.list_extend(files, vim.fn.expand(plugin.dir .. "/" .. file, false, true))
end
---@type table<string,{file:string, tag:string, line:string}> ---@type table<string,{file:string, tag:string, line:string}>
local tags = {} local tags = {}