diff --git a/src/text_editor/buffer.cpp b/src/text_editor/buffer.cpp index 268e0e2..e4c9893 100644 --- a/src/text_editor/buffer.cpp +++ b/src/text_editor/buffer.cpp @@ -405,7 +405,7 @@ CharClass GetCharClass(char16_t c) { API Int OnCharClassBoundary_GetNextWordEnd(Buffer *buffer, Int pos) { 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; } @@ -420,7 +420,7 @@ API Int OnCharClassBoundary_GetPrevWordStart(Buffer *buffer, Int pos) { pos = Clamp(pos, (Int)0, buffer->len); Int i = pos - 1; - while (i >= 0 && GetCharClass(buffer->str[i]) == CharClass_Whitespace) { + if (i >= 0 && GetCharClass(buffer->str[i]) == CharClass_Whitespace) { i -= 1; } diff --git a/src/text_editor/window_command.cpp b/src/text_editor/window_command.cpp index 090738a..a17e66a 100644 --- a/src/text_editor/window_command.cpp +++ b/src/text_editor/window_command.cpp @@ -98,9 +98,9 @@ void CommandWindowLayout(Rect2I *rect, Int wx, Int wy) { int32_t FuzzyRate(String16 string, String16 with) { ProfileFunction(); if (with.len == 0) return 0; - int32_t points = 0; + int32_t points = 0; int32_t consecutive = 0; - int32_t with_i = 0; + int32_t with_i = 0; for (int32_t i = 0; i < string.len; i++) { if (ToLowerCase(string.data[i]) == ToLowerCase(with[with_i])) { consecutive += 1;