diff options
author | Christian Clason <c.clason@uni-graz.at> | 2023-04-14 10:39:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-14 10:39:57 +0200 |
commit | 4d04feb6629cb049cb2a13ba35f0c8d3c6b67ff4 (patch) | |
tree | 17dadca32fa46116a9c576fc651a61bc5da8ece4 /runtime/lua/vim/lsp/util.lua | |
parent | 72a327cad20fa2dbb214177cc48c533543d5b9e8 (diff) | |
download | rneovim-4d04feb6629cb049cb2a13ba35f0c8d3c6b67ff4.tar.gz rneovim-4d04feb6629cb049cb2a13ba35f0c8d3c6b67ff4.tar.bz2 rneovim-4d04feb6629cb049cb2a13ba35f0c8d3c6b67ff4.zip |
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.
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
-rw-r--r-- | runtime/lua/vim/lsp/util.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index dca258e4b9..31af2afb0b 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -1476,7 +1476,7 @@ end local function close_preview_window(winnr, bufnrs) vim.schedule(function() -- exit if we are in one of ignored buffers - if bufnrs and vim.tbl_contains(bufnrs, api.nvim_get_current_buf()) then + if bufnrs and vim.list_contains(bufnrs, api.nvim_get_current_buf()) then return end |