diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2024-04-21 15:19:43 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2024-04-21 17:08:07 +0200 |
commit | d9d890562e43493c999f8a6ff2b848959686f5b6 (patch) | |
tree | e2f751afe697c4e95a37b00b2d75690ca173122d /runtime/lua/vim/shared.lua | |
parent | 032df963bb3fb0b5652e1817e9f4da986996fa6d (diff) | |
download | rneovim-d9d890562e43493c999f8a6ff2b848959686f5b6.tar.gz rneovim-d9d890562e43493c999f8a6ff2b848959686f5b6.tar.bz2 rneovim-d9d890562e43493c999f8a6ff2b848959686f5b6.zip |
refactor(lua): rename tbl_islist => islist
ref #24572
Diffstat (limited to 'runtime/lua/vim/shared.lua')
-rw-r--r-- | runtime/lua/vim/shared.lua | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/runtime/lua/vim/shared.lua b/runtime/lua/vim/shared.lua index eb51c244ef..6d9e4ad809 100644 --- a/runtime/lua/vim/shared.lua +++ b/runtime/lua/vim/shared.lua @@ -601,7 +601,7 @@ end --- Tests if `t` is an "array": a table indexed _only_ by integers (potentially non-contiguous). --- ---- If the indexes start from 1 and are contiguous then the array is also a list. |vim.tbl_islist()| +--- If the indexes start from 1 and are contiguous then the array is also a list. |vim.islist()| --- --- Empty table `{}` is an array, unless it was created by |vim.empty_dict()| or returned as --- a dict-like |API| or Vimscript result, for example from |rpcrequest()| or |vim.fn|. @@ -640,6 +640,12 @@ function vim.tbl_isarray(t) end end +--- @deprecated +function vim.tbl_islist(t) + vim.deprecate('vim.tbl_islist', 'vim.islist', '0.12') + return vim.islist(t) +end + --- Tests if `t` is a "list": a table indexed _only_ by contiguous integers starting from 1 (what --- |lua-length| calls a "regular array"). --- @@ -648,9 +654,9 @@ end --- ---@see |vim.tbl_isarray()| --- ----@param t table +---@param t? table ---@return boolean `true` if list-like table, else `false`. -function vim.tbl_islist(t) +function vim.islist(t) if type(t) ~= 'table' then return false end |