Skip to content

Commit 0c12735

Browse files
authored
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).
1 parent 33f04c3 commit 0c12735

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lua/telescope/utils.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ utils.islist = vim.fn.has "nvim-0.10" == 1 and vim.islist or vim.tbl_islist
2222
local flatten = function(t)
2323
return vim.iter(t):flatten():totable()
2424
end
25-
utils.flatten = vim.fn.has "nvim-0.10" == 1 and flatten or vim.tbl_flatten
25+
utils.flatten = vim.fn.has "nvim-0.11" == 1 and flatten or vim.tbl_flatten
2626

2727
--- Hybrid of `vim.fn.expand()` and custom `vim.fs.normalize()`
2828
---

plugin/telescope.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ end, {
118118
if n == 0 then
119119
local commands = { builtin_list, extensions_list }
120120
-- TODO(clason): remove when dropping support for Nvim 0.9
121-
if vim.fn.has "nvim-0.10" == 1 then
121+
if vim.fn.has "nvim-0.11" == 1 then
122122
commands = vim.iter(commands):flatten():totable()
123123
else
124124
commands = vim.tbl_flatten(commands)

0 commit comments

Comments
 (0)