update lock clucknut
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 14s
Build, Push and Deploy / build-and-push (push) Successful in 3m14s
Build, Push and Deploy / deploy-staging (push) Successful in 25s
Build, Push and Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-04-18 20:32:18 +07:00
parent 4554035227
commit dcaf267458
3359 changed files with 153185 additions and 205489 deletions

View File

@@ -575,6 +575,8 @@ private function pad(int $len, self $pad, int $type): static
private function wcswidth(string $string): int
{
$width = 0;
$lastChar = null;
$lastWidth = null;
foreach (preg_split('//u', $string, -1, \PREG_SPLIT_NO_EMPTY) as $c) {
$codePoint = mb_ord($c, 'UTF-8');
@@ -597,6 +599,20 @@ private function wcswidth(string $string): int
return -1;
}
if (0xFE0F === $codePoint) {
if (\PCRE_VERSION_MAJOR < 10 || \PCRE_VERSION_MAJOR === 10 && \PCRE_VERSION_MINOR < 40) {
$regex = '/\p{So}/u';
} else {
$regex = '/\p{Emoji}/u';
}
if (null !== $lastChar && 1 === $lastWidth && preg_match($regex, $lastChar)) {
++$width;
$lastWidth = 2;
}
continue;
}
self::$tableZero ??= require __DIR__.'/Resources/data/wcswidth_table_zero.php';
if ($codePoint >= self::$tableZero[0][0] && $codePoint <= self::$tableZero[$ubound = \count(self::$tableZero) - 1][1]) {
@@ -627,6 +643,8 @@ private function wcswidth(string $string): int
$ubound = $mid - 1;
} else {
$width += 2;
$lastChar = $c;
$lastWidth = 2;
continue 2;
}
@@ -634,6 +652,8 @@ private function wcswidth(string $string): int
}
++$width;
$lastChar = $c;
$lastWidth = 1;
}
return $width;