aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-08-21 09:15:20 +0800
committerGitHub <noreply@github.com>2025-08-21 09:15:20 +0800
commitfbaead249b15b2ad408eae689c2407924bc52225 (patch)
treeeaac150fa93db1a1c29b802395881427d254b5e8 /runtime/lua/vim
parent848c7a7894709a5bf73cd09d5612c35426994c0e (diff)
parent7d53982b7f7991e27ebffd5159de012d900a244c (diff)
downloadrneovim-fbaead249b15b2ad408eae689c2407924bc52225.tar.gz
rneovim-fbaead249b15b2ad408eae689c2407924bc52225.tar.bz2
rneovim-fbaead249b15b2ad408eae689c2407924bc52225.zip
Merge pull request #35410 from zeertzjq/vim-308a313
vim-patch: doc updates
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r--runtime/lua/vim/_meta/vimfn.lua25
1 files changed, 15 insertions, 10 deletions
diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua
index c1ac7c3fab..af8e4b786c 100644
--- a/runtime/lua/vim/_meta/vimfn.lua
+++ b/runtime/lua/vim/_meta/vimfn.lua
@@ -4908,22 +4908,27 @@ function vim.fn.islocked(expr) end
--- @return 0|1
function vim.fn.isnan(expr) end
---- Return a |List| with all the key-value pairs of {dict}. Each
---- |List| item is a list with two items: the key of a {dict}
---- entry and the value of this entry. The |List| is in arbitrary
---- order. Also see |keys()| and |values()|.
+--- Return a |List| with all key/index and value pairs of {expr}.
+--- Each |List| item is a list with two items:
+--- - for a |Dict|: the key and the value
+--- - for a |List| or |String|: the index and the value
+--- The returned |List| is in arbitrary order for a |Dict|,
+--- otherwise it's in ascending order of the index.
+---
+--- Also see |keys()| and |values()|.
+---
--- Example: >vim
+--- let mydict = #{a: 'red', b: 'blue'}
--- for [key, value] in items(mydict)
---- echo key .. ': ' .. value
+--- echo $"{key} = {value}"
--- endfor
+--- echo items([1, 2, 3])
+--- echo items("foobar")
--- <
---- A List or a String argument is also supported. In these
---- cases, items() returns a List with the index and the value at
---- the index.
---
---- @param dict table
+--- @param expr table|string
--- @return any
-function vim.fn.items(dict) end
+function vim.fn.items(expr) end
--- @deprecated
--- Obsolete name for |chanclose()|