mirror of
https://github.com/neovim/neovim.git
synced 2026-04-30 19:24:09 +00:00
feat(lua): vim.tbl_contains supports general tables and predicates (#23040)
* feat(lua): vim.tbl_contains supports general tables and predicates Problem: `vim.tbl_contains` only works for list-like tables (integer keys without gaps) and primitive values (in particular, not for nested tables). Solution: Rename `vim.tbl_contains` to `vim.list_contains` and add new `vim.tbl_contains` that works for general tables and optionally allows `value` to be a predicate function that is checked for every key.
This commit is contained in:
@@ -449,7 +449,7 @@ local function python()
|
||||
local path_bin = vim.fs.normalize(path .. '/' .. pyname)
|
||||
if
|
||||
path_bin ~= vim.fs.normalize(python_exe)
|
||||
and vim.tbl_contains(python_multiple, path_bin)
|
||||
and vim.list_contains(python_multiple, path_bin)
|
||||
and executable(path_bin)
|
||||
then
|
||||
python_multiple[#python_multiple + 1] = path_bin
|
||||
|
||||
Reference in New Issue
Block a user