Improve ctrl deletes

This commit is contained in:
Krzosa Karol
2026-01-05 12:28:09 +01:00
parent c0d00a6211
commit f646a6d22c
2 changed files with 4 additions and 4 deletions

View File

@@ -405,7 +405,7 @@ CharClass GetCharClass(char16_t c) {
API Int OnCharClassBoundary_GetNextWordEnd(Buffer *buffer, Int pos) { API Int OnCharClassBoundary_GetNextWordEnd(Buffer *buffer, Int pos) {
Int i = Clamp(pos, (Int)0, buffer->len); Int i = Clamp(pos, (Int)0, buffer->len);
while (i < buffer->len && GetCharClass(buffer->str[i]) == CharClass_Whitespace) { if (i < buffer->len && GetCharClass(buffer->str[i]) == CharClass_Whitespace) {
i += 1; i += 1;
} }
@@ -420,7 +420,7 @@ API Int OnCharClassBoundary_GetPrevWordStart(Buffer *buffer, Int pos) {
pos = Clamp(pos, (Int)0, buffer->len); pos = Clamp(pos, (Int)0, buffer->len);
Int i = pos - 1; Int i = pos - 1;
while (i >= 0 && GetCharClass(buffer->str[i]) == CharClass_Whitespace) { if (i >= 0 && GetCharClass(buffer->str[i]) == CharClass_Whitespace) {
i -= 1; i -= 1;
} }