Skip to content

Commit 4429e81

Browse files
committed
update document of utf8.offset in Lua 5.5
1 parent da33ef5 commit 4429e81

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
## Unreleased
44
<!-- Add all new changes here. They will be moved under a version at release -->
55

6+
## 3.16.4
7+
* `FIX` (VSCode) Broken `view document`
8+
9+
610
## 3.16.3
711
`2025-12-23`
812
* `CHG` Upgraded to Lua 5.5, memory usage has been reduced by ~10%

locale/en-us/meta.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,3 +881,5 @@ utf8.len =
881881
'Returns the number of UTF-8 characters in string `s` that start between positions `i` and `j` (both inclusive).'
882882
utf8.offset =
883883
'Returns the position (in bytes) where the encoding of the `n`-th character of `s` (counting from position `i`) starts.'
884+
utf8.offset[55] =
885+
'Returns the position of the n-th character of s (counting from byte position i) as two integers: The index (in bytes) where its encoding starts and the index (in bytes) where it ends.'

meta/template/utf8.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,25 @@ function utf8.len(s, i, j) end
6767
function utf8.len(s, i, j, lax) end
6868
---#end
6969

70+
---#if VERSION <= 5.4 then
7071
---#DES 'utf8.offset'
7172
---@param s string
7273
---@param n integer
7374
---@param i? integer
7475
---@return integer p
7576
---@nodiscard
7677
function utf8.offset(s, n, i) end
78+
---#end
79+
80+
---#if VERSION >= 5.5 then
81+
---#DES 'utf8.offset.55'
82+
---@param s string
83+
---@param n integer
84+
---@param i? integer
85+
---@return integer ps
86+
---@return integer pe
87+
---@nodiscard
88+
function utf8.offset(s, n, i) end
89+
---#end
7790

7891
return utf8

0 commit comments

Comments
 (0)