Improve ctrl deletes
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user