aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-08-19 18:33:44 +0800
committerGitHub <noreply@github.com>2023-08-19 18:33:44 +0800
commitd9b094660944969b5160f2d22f0c2e8627e10d92 (patch)
tree9fd8d4342f77ed25e5abba5f697a827b3f3de38b /runtime
parentd7ae9ae3e52362da33902c31ecccc79c49d3866e (diff)
parentfcd729f22c658826024467801ae4ba0a92a8fabc (diff)
downloadrneovim-d9b094660944969b5160f2d22f0c2e8627e10d92.tar.gz
rneovim-d9b094660944969b5160f2d22f0c2e8627e10d92.tar.bz2
rneovim-d9b094660944969b5160f2d22f0c2e8627e10d92.zip
Merge pull request #24787 from zeertzjq/vim-9.0.1515
vim-patch:9.0.{1515,1540,1738}
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/builtin.txt12
-rw-r--r--runtime/doc/usr_41.txt4
-rw-r--r--runtime/lua/vim/_meta/vimfn.lua12
3 files changed, 17 insertions, 11 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 9a662761c4..0ae615ac3f 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -5666,11 +5666,13 @@ resolve({filename}) *resolve()* *E65
path name) and also keeps a trailing path separator.
reverse({object}) *reverse()*
- Reverse the order of items in {object} in-place.
- {object} can be a |List| or a |Blob|.
- Returns {object}.
- Returns zero if {object} is not a List or a Blob.
- If you want an object to remain unmodified make a copy first: >vim
+ Reverse the order of items in {object}. {object} can be a
+ |List|, a |Blob| or a |String|. For a List and a Blob the
+ items are reversed in-place and {object} is returned.
+ For a String a new String is returned.
+ Returns zero if {object} is not a List, Blob or a String.
+ If you want a List or Blob to remain unmodified make a copy
+ first: >vim
let revlist = reverse(copy(mylist))
<
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index ac371cf0e3..c8b31b2d5b 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -626,6 +626,7 @@ String manipulation: *string-functions*
strdisplaywidth() size of string when displayed, deals with tabs
setcellwidths() set character cell width overrides
getcellwidths() get character cell width overrides
+ reverse() reverse the order of characters in a string
substitute() substitute a pattern match with a string
submatch() get a specific match in ":s" and substitute()
strpart() get part of a string using byte index
@@ -664,7 +665,7 @@ List manipulation: *list-functions*
reduce() reduce a List to a value
slice() take a slice of a List
sort() sort a List
- reverse() reverse the order of a List or Blob
+ reverse() reverse the order of items in a List
uniq() remove copies of repeated adjacent items
split() split a String into a List
join() join List items into a String
@@ -731,6 +732,7 @@ Floating point computation: *float-functions*
Blob manipulation: *blob-functions*
blob2list() get a list of numbers from a blob
list2blob() get a blob from a list of numbers
+ reverse() reverse the order of numbers in a blob
Other computation: *bitwise-function*
and() bitwise AND
diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua
index 8ae6dd5f10..030f268f81 100644
--- a/runtime/lua/vim/_meta/vimfn.lua
+++ b/runtime/lua/vim/_meta/vimfn.lua
@@ -6762,11 +6762,13 @@ vim.fn['repeat'] = function(expr, count) end
--- @return any
function vim.fn.resolve(filename) end
---- Reverse the order of items in {object} in-place.
---- {object} can be a |List| or a |Blob|.
---- Returns {object}.
---- Returns zero if {object} is not a List or a Blob.
---- If you want an object to remain unmodified make a copy first: >vim
+--- Reverse the order of items in {object}. {object} can be a
+--- |List|, a |Blob| or a |String|. For a List and a Blob the
+--- items are reversed in-place and {object} is returned.
+--- For a String a new String is returned.
+--- Returns zero if {object} is not a List, Blob or a String.
+--- If you want a List or Blob to remain unmodified make a copy
+--- first: >vim
--- let revlist = reverse(copy(mylist))
--- <
---