We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4bbe8ea commit dbcff9eCopy full SHA for dbcff9e
lua/orgmode/utils/init.lua
@@ -489,6 +489,13 @@ function utils.pad_right(str, amount)
489
return string.format('%s%s', str, string.rep(' ', spaces))
490
end
491
492
+function utils.is_list(value)
493
+ if vim.islist then
494
+ return vim.islist(value)
495
+ end
496
+ return vim.tbl_islist(value)
497
+end
498
+
499
---@param t table List-like table
500
---@return table Flattened copy of the given list-like table
501
function utils.flatten(t)
@@ -497,7 +504,7 @@ function utils.flatten(t)
504
local n = #_t
505
for i = 1, n do
506
local v = _t[i]
- if type(v) == 'table' and vim.tbl_islist(v) then
507
+ if type(v) == 'table' and utils.is_list(v) then
508
_tbl_flatten(v)
502
509
elseif v then
503
510
table.insert(result, v)
0 commit comments