From 94750763850b4cb8051a7ee155ca403322726e44 Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 26 Apr 2019 07:53:21 +1000 Subject: Feature [feature-requests:#1238]. Simplify camel case forcing by checking only for upper and lower case characters instead of current word characters. This changes behaviour for words like "_word" -> "_Word" instead of remaining "_word" but that doesn't matter for this feature's intended use which is to allow display of ASCII-only keywords in the user's preferred casing (else/ELSE/Else) for languages with case-insensitive keywords. --- src/EditView.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/EditView.cxx') diff --git a/src/EditView.cxx b/src/EditView.cxx index ffeb20648..c4370632b 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -387,8 +387,8 @@ void EditView::LayoutLine(const EditModel &model, Sci::Line line, Surface *surfa allSame = allSame && (ll->chars[numCharsInLine] == MakeUpperCase(chDoc)); else { // Style::caseCamel - if ((model.pdoc->IsASCIIWordByte(ll->chars[numCharsInLine])) && - ((numCharsInLine == 0) || (!model.pdoc->IsASCIIWordByte(ll->chars[numCharsInLine - 1])))) { + if ((IsUpperOrLowerCase(ll->chars[numCharsInLine])) && + ((numCharsInLine == 0) || (!IsUpperOrLowerCase(ll->chars[numCharsInLine - 1])))) { allSame = allSame && (ll->chars[numCharsInLine] == MakeUpperCase(chDoc)); } else { allSame = allSame && (ll->chars[numCharsInLine] == MakeLowerCase(chDoc)); @@ -434,8 +434,8 @@ void EditView::LayoutLine(const EditModel &model, Sci::Line line, Surface *surfa else if (vstyle.styles[ll->styles[charInLine]].caseForce == Style::caseLower) ll->chars[charInLine] = MakeLowerCase(chDoc); else if (vstyle.styles[ll->styles[charInLine]].caseForce == Style::caseCamel) { - if ((model.pdoc->IsASCIIWordByte(ll->chars[charInLine])) && - ((charInLine == 0) || (!model.pdoc->IsASCIIWordByte(ll->chars[charInLine - 1])))) { + if ((IsUpperOrLowerCase(ll->chars[charInLine])) && + ((charInLine == 0) || (!IsUpperOrLowerCase(ll->chars[charInLine - 1])))) { ll->chars[charInLine] = MakeUpperCase(chDoc); } else { ll->chars[charInLine] = MakeLowerCase(chDoc); -- cgit v1.2.3