Skip to content

Commit

Permalink
fix: flatten leaving empty tables (#799)
Browse files Browse the repository at this point in the history
  • Loading branch information
Quitlox authored Dec 27, 2024
1 parent 8a092ce commit 021216d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/blink/cmp/lib/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,15 @@ function utils.flatten(t)

local flattened = {}
for _, v in ipairs(t) do
if type(v) == 'table' and vim.tbl_isempty(v) then goto continue end

if v[1] == nil then
table.insert(flattened, v)
else
vim.list_extend(flattened, utils.flatten(v))
end

::continue::
end
return flattened
end
Expand Down

0 comments on commit 021216d

Please sign in to comment.