From bbb934e7755a3b6f14c4d94334b8f54c63daebf1 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 14 Jun 2023 20:54:11 +0800 Subject: vim-patch:9.0.1629: having utf16idx() rounding up is inconvenient (#24019) Problem: Having utf16idx() rounding up is inconvenient. Solution: Make utf16idx() round down. (Yegappan Lakshmanan, closes vim/vim#12523) https://github.com/vim/vim/commit/95707037afa1aeae4f3494dc623a721ceed7fc4e Co-authored-by: Yegappan Lakshmanan --- runtime/doc/builtin.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 1fea6ad715..938523b6ee 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -9146,8 +9146,8 @@ utf16idx({string}, {idx} [, {countcc} [, {charidx}]]) When {charidx} is present and TRUE, {idx} is used as the character index in the String {string} instead of as the byte index. - An {idx} in the middle of a UTF-8 sequence is rounded upwards - to the end of that sequence. + An {idx} in the middle of a UTF-8 sequence is rounded + downwards to the beginning of that sequence. Returns -1 if the arguments are invalid or if there are less than {idx} bytes in {string}. If there are exactly {idx} bytes -- cgit