From 4c7df98e4eeed20f8a9c461729935b79743d7752 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 19 Aug 2023 17:44:19 +0800 Subject: vim-patch:9.0.1515: reverse() does not work for a String Problem: reverse() does not work for a String. Solution: Implement reverse() for a String. (Yegappan Lakshmanan, closes vim/vim#12179) https://github.com/vim/vim/commit/03ff1c2dde7f15eca5c9baa6dafbda9b49bedc3b vim-patch:9.0.1738: Duplicate code to reverse a string Problem: Duplicate code to reverse a string Solution: Move reverse_text() to strings.c and remove string_reverse(). closes: vim/vim#12847 https://github.com/vim/vim/commit/4dd266cb66d901cf5324f09405cfea3f004bd29f Co-authored-by: Yegappan Lakshmanan --- src/nvim/eval.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 2b89d34a6d..154023b25f 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -8151,11 +8151,13 @@ M.funcs = { args = 1, base = 1, desc = [=[ - 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)) < ]=], -- cgit