mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-18 16:10:26 +02:00
Improved right-cursor movement over utf8 codepoints
This commit is contained in:
parent
04f1802303
commit
f96de4722e
3 changed files with 41 additions and 4 deletions
|
@ -359,6 +359,23 @@ namespace System
|
|||
}
|
||||
}
|
||||
|
||||
public int NumCodePoints
|
||||
{
|
||||
get
|
||||
{
|
||||
char8* ptr = Ptr;
|
||||
|
||||
int count = 0;
|
||||
for (int i < mLength)
|
||||
{
|
||||
char8 c = ptr[i];
|
||||
if (((uint8)c & 0xC0) != 0x80)
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
||||
public int AllocSize
|
||||
{
|
||||
[Inline]
|
||||
|
@ -3594,6 +3611,23 @@ namespace System
|
|||
}
|
||||
}
|
||||
|
||||
public int NumCodePoints
|
||||
{
|
||||
get
|
||||
{
|
||||
char8* ptr = Ptr;
|
||||
|
||||
int count = 0;
|
||||
for (int i < mLength)
|
||||
{
|
||||
char8 c = ptr[i];
|
||||
if (((uint8)c & 0xC0) != 0x80)
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
||||
private int GetRangeStart(IndexRange range)
|
||||
{
|
||||
switch (range.Start)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue