@@ -37,6 +37,14 @@ local F = require "plenary.functional"
37
37
local J = require " plenary.job"
38
38
local P = require " plenary.path"
39
39
40
+ local flatten = function (t )
41
+ if vim .fn .has " nvim-0.11" == 1 then
42
+ return vim .iter (t ):flatten ():totable ()
43
+ else
44
+ return vim .tbl_flatten (t )
45
+ end
46
+ end
47
+
40
48
-- Utils ----------------------------------------------------
41
49
---- ---------------------------------------------------------
42
50
@@ -54,7 +62,7 @@ util.url_encode = function(str)
54
62
end
55
63
56
64
util .kv_to_list = function (kv , prefix , sep )
57
- return vim . tbl_flatten (F .kv_map (function (kvp )
65
+ return flatten (F .kv_map (function (kvp )
58
66
return { prefix , kvp [1 ] .. sep .. kvp [2 ] }
59
67
end , kv ))
60
68
end
@@ -243,7 +251,7 @@ parse.request = function(opts)
243
251
table.insert (result , { " -o" , opts .output })
244
252
end
245
253
table.insert (result , parse .url (opts .url , opts .query ))
246
- return vim . tbl_flatten (result ), opts
254
+ return flatten (result ), opts
247
255
end
248
256
249
257
-- Parse response ------------------------------------------
0 commit comments