fixup: adapt to deprecations in Nvim 0.10 (#3113)

vim.iter.flatten() is not a full replacement (does not support arrays
with `nil`); a fix may be backported but for now only use it on nightly
(0.10 has no warnings yet).
This commit is contained in:
Christian Clason
2024-05-17 20:02:19 +02:00
committed by GitHub
parent 33f04c3a86
commit 0c12735d5a
2 changed files with 2 additions and 2 deletions

View File

@@ -22,7 +22,7 @@ utils.islist = vim.fn.has "nvim-0.10" == 1 and vim.islist or vim.tbl_islist
local flatten = function(t)
return vim.iter(t):flatten():totable()
end
utils.flatten = vim.fn.has "nvim-0.10" == 1 and flatten or vim.tbl_flatten
utils.flatten = vim.fn.has "nvim-0.11" == 1 and flatten or vim.tbl_flatten
--- Hybrid of `vim.fn.expand()` and custom `vim.fs.normalize()`
---