fix: adapt to Nvim deprecations in 0.10 (#3109)

This commit is contained in:
Christian Clason
2024-05-17 14:39:12 +02:00
committed by GitHub
parent 96610122a4
commit bbdbb7593f
10 changed files with 34 additions and 17 deletions

View File

@@ -270,6 +270,7 @@ resolver.resolve_anchor_pos = function(anchor, p_width, p_height, max_columns, m
return pos
end
-- duplicate from utils.lua to keep self-contained
-- Win option always returns a table with preview, results, and prompt.
-- It handles many different ways. Some examples are as follows:
--
@@ -292,7 +293,8 @@ end
-- prompt = {...},
-- }
resolver.win_option = function(val, default)
if type(val) ~= "table" or vim.tbl_islist(val) then
local islist = require("telescope.utils").islist
if type(val) ~= "table" or islist(val) then
if val == nil then
val = default
end
@@ -303,7 +305,7 @@ resolver.win_option = function(val, default)
prompt = val,
}
elseif type(val) == "table" then
assert(not vim.tbl_islist(val))
assert(not islist(val))
local val_to_set = val[1]
if val_to_set == nil then