comparison runtime/doc/builtin.txt @ 32595:a699363f01cd v9.0.1629

patch 9.0.1629: having utf16idx() rounding up is inconvenient Commit: https://github.com/vim/vim/commit/95707037afa1aeae4f3494dc623a721ceed7fc4e Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Wed Jun 14 13:10:15 2023 +0100 patch 9.0.1629: having utf16idx() rounding up is inconvenient Problem: Having utf16idx() rounding up is inconvenient. Solution: Make utf16idx() round down. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/12523)
author Bram Moolenaar <Bram@vim.org>
date Wed, 14 Jun 2023 14:15:04 +0200
parents 635de73eeb4c
children 448aef880252
comparison
equal deleted inserted replaced
32594:b3dc1ac1ad16 32595:a699363f01cd
10125 the byte at {idx} in {string} (after converting it to UTF-16). 10125 the byte at {idx} in {string} (after converting it to UTF-16).
10126 10126
10127 When {charidx} is present and TRUE, {idx} is used as the 10127 When {charidx} is present and TRUE, {idx} is used as the
10128 character index in the String {string} instead of as the byte 10128 character index in the String {string} instead of as the byte
10129 index. 10129 index.
10130 An {idx} in the middle of a UTF-8 sequence is rounded upwards 10130 An {idx} in the middle of a UTF-8 sequence is rounded
10131 to the end of that sequence. 10131 downwards to the beginning of that sequence.
10132 10132
10133 Returns -1 if the arguments are invalid or if there are less 10133 Returns -1 if the arguments are invalid or if there are less
10134 than {idx} bytes in {string}. If there are exactly {idx} bytes 10134 than {idx} bytes in {string}. If there are exactly {idx} bytes
10135 the length of the string in UTF-16 code units is returned. 10135 the length of the string in UTF-16 code units is returned.
10136 10136