From 1fdacbb3e4e118c7bc3cd03ea16b21a68c7c9631 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 21 Aug 2025 08:34:20 +0800 Subject: [PATCH] vim-patch:44c8072: runtime(doc): fix style and clarify items() function for String type related: vim/vim#18021 https://github.com/vim/vim/commit/44c8072ef64a7a218eb8cf4b72866921762633e4 Co-authored-by: Christian Brabandt --- runtime/doc/usr_41.txt | 1 + runtime/doc/vimfn.txt | 2 +- runtime/lua/vim/_meta/vimfn.lua | 2 +- src/nvim/eval.lua | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index 70c90057de..fc2512d5d8 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -650,6 +650,7 @@ String manipulation: *string-functions* win_execute() like execute() but in a specified window trim() trim characters from a string gettext() lookup message translation + items() get List of String index-character pairs List manipulation: *list-functions* get() get an item without error for wrong index diff --git a/runtime/doc/vimfn.txt b/runtime/doc/vimfn.txt index bbe707c57b..17cc3f94c5 100644 --- a/runtime/doc/vimfn.txt +++ b/runtime/doc/vimfn.txt @@ -5425,7 +5425,7 @@ isnan({expr}) *isnan()* (`0|1`) items({expr}) *items()* - Return a |List| with all the key/index and value pairs of {expr}. + 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 diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index 5312167c44..3d96bf7255 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -4908,7 +4908,7 @@ function vim.fn.islocked(expr) end --- @return 0|1 function vim.fn.isnan(expr) end ---- Return a |List| with all the key/index and value pairs of {expr}. +--- 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 diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index ca868edac4..e661c7ee8f 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -6057,7 +6057,7 @@ M.funcs = { args = 1, base = 1, desc = [=[ - Return a |List| with all the key/index and value pairs of {expr}. + 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