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;
} }

View File

@@ -98,9 +98,9 @@ void CommandWindowLayout(Rect2I *rect, Int wx, Int wy) {
int32_t FuzzyRate(String16 string, String16 with) { int32_t FuzzyRate(String16 string, String16 with) {
ProfileFunction(); ProfileFunction();
if (with.len == 0) return 0; if (with.len == 0) return 0;
int32_t points = 0; int32_t points = 0;
int32_t consecutive = 0; int32_t consecutive = 0;
int32_t with_i = 0; int32_t with_i = 0;
for (int32_t i = 0; i < string.len; i++) { for (int32_t i = 0; i < string.len; i++) {
if (ToLowerCase(string.data[i]) == ToLowerCase(with[with_i])) { if (ToLowerCase(string.data[i]) == ToLowerCase(with[with_i])) {
consecutive += 1; consecutive += 1;