summaryrefslogtreecommitdiff
path: root/core/src/xmake/engine.c
diff options
context:
space:
mode:
authorruki <[email protected]>2026-01-21 00:38:05 +0800
committerruki <[email protected]>2026-01-21 00:38:05 +0800
commit4c08bae6d49e37102c0b889ff7afcc9f319435db (patch)
tree4e6c7c4903b8a9145ca36992eb1aaad160d4c504 /core/src/xmake/engine.c
parent443fc30ae713b14623ac20bd5f1e8fdb12740783 (diff)
add utf8.width
Diffstat (limited to 'core/src/xmake/engine.c')
-rw-r--r--core/src/xmake/engine.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/src/xmake/engine.c b/core/src/xmake/engine.c
index 9ef4ec68f..146cdd17a 100644
--- a/core/src/xmake/engine.c
+++ b/core/src/xmake/engine.c
@@ -288,6 +288,7 @@ tb_int_t xm_utf8_codes(lua_State *lua);
tb_int_t xm_utf8_sub(lua_State *lua);
tb_int_t xm_utf8_lastof(lua_State *lua);
tb_int_t xm_utf8_find(lua_State *lua);
+tb_int_t xm_utf8_width(lua_State *lua);
// the string functions
tb_int_t xm_string_trim(lua_State *lua);
@@ -603,6 +604,9 @@ static luaL_Reg const g_utf8_functions[] = {
{"sub", xm_utf8_sub},
{"lastof", xm_utf8_lastof},
{"find", xm_utf8_find},
+ {"width", xm_utf8_width},
+ {"wcwidth", xm_utf8_width},
+ {"wcswidth", xm_utf8_width},
{tb_null, tb_null}
};