File tree Expand file tree Collapse file tree
lua/vectorcode/integrations/codecompanion Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,18 +16,21 @@ return {
1616 if type (t ) == " string" then
1717 return t
1818 end
19-
19+
2020 -- Handle empty tables or tables with empty strings
21- local flattened = vim .iter (t ):flatten (math.huge ):totable ()
22- local non_empty = vim .iter (flattened ):filter (function (item )
23- return type (item ) == " string" and vim .trim (item ) ~= " "
24- end ):totable ()
25-
26- if # non_empty == 0 then
21+ local flattened = vim
22+ .iter (t )
23+ :flatten (math.huge )
24+ :filter (function (item )
25+ return type (item ) == " string" and vim .trim (item ) ~= " "
26+ end )
27+ :totable ()
28+
29+ if # flattened == 0 then
2730 return " Unknown error occurred"
2831 end
29-
30- return table.concat (non_empty , " \n " )
32+
33+ return table.concat (flattened , " \n " )
3134 end ,
3235
3336 --- @param use_lsp boolean
You can’t perform that action at this time.
0 commit comments