Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit dbcff9e

Browse files
fix(deprecated): Update deprecated tbl_islist call
1 parent 4bbe8ea commit dbcff9e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lua/orgmode/utils/init.lua

+8-1
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,13 @@ function utils.pad_right(str, amount)
489489
return string.format('%s%s', str, string.rep(' ', spaces))
490490
end
491491

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+
492499
---@param t table List-like table
493500
---@return table Flattened copy of the given list-like table
494501
function utils.flatten(t)
@@ -497,7 +504,7 @@ function utils.flatten(t)
497504
local n = #_t
498505
for i = 1, n do
499506
local v = _t[i]
500-
if type(v) == 'table' and vim.tbl_islist(v) then
507+
if type(v) == 'table' and utils.is_list(v) then
501508
_tbl_flatten(v)
502509
elseif v then
503510
table.insert(result, v)

0 commit comments

Comments
 (0)