aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc/ScintillaDoc.html4
-rw-r--r--doc/ScintillaHistory.html3
-rw-r--r--include/Scintilla.h1
-rw-r--r--include/Scintilla.iface1
-rw-r--r--src/EditView.cxx18
-rw-r--r--src/Style.h2
6 files changed, 25 insertions, 4 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index 6e3bab3a6..ed0429efc 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -2699,8 +2699,8 @@ struct Sci_TextToFind {
<p><b id="SCI_STYLESETCASE">SCI_STYLESETCASE(int styleNumber, int caseMode)</b><br />
<b id="SCI_STYLEGETCASE">SCI_STYLEGETCASE(int styleNumber)</b><br />
The value of caseMode determines how text is displayed. You can set upper case
- (<code>SC_CASE_UPPER</code>, 1) or lower case (<code>SC_CASE_LOWER</code>, 2) or display
- normally (<code>SC_CASE_MIXED</code>, 0). This does not change the stored text, only how it is
+ (<code>SC_CASE_UPPER</code>, 1) or lower case (<code>SC_CASE_LOWER</code>, 2) or camel case (<code>SC_CASE_CAMEL</code>, 3)
+ or display normally (<code>SC_CASE_MIXED</code>, 0). This does not change the stored text, only how it is
displayed.</p>
<p><b id="SCI_STYLESETVISIBLE">SCI_STYLESETVISIBLE(int styleNumber, bool visible)</b><br />
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index e0954a858..f2e9528eb 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -498,6 +498,9 @@
This change in behaviours is conditional on setting the SCI_SETADDITIONALSELECTIONTYPING property.
</li>
<li>
+ The case mode style attribute can now be SC_CASE_CAMEL.
+ </li>
+ <li>
On Cocoa fix problems with positioning of autocompletion lists near screen edge
or under dock. Cancel autocompletion when window moved.
<a href="http://sourceforge.net/p/scintilla/bugs/1740/">Bug #1740</a>.
diff --git a/include/Scintilla.h b/include/Scintilla.h
index 50deb755e..7244bded8 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -217,6 +217,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SC_CASE_MIXED 0
#define SC_CASE_UPPER 1
#define SC_CASE_LOWER 2
+#define SC_CASE_CAMEL 3
#define SCI_STYLEGETFORE 2481
#define SCI_STYLEGETBACK 2482
#define SCI_STYLEGETBOLD 2483
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index 9a084785a..818a2ca38 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -462,6 +462,7 @@ enu CaseVisible=SC_CASE_
val SC_CASE_MIXED=0
val SC_CASE_UPPER=1
val SC_CASE_LOWER=2
+val SC_CASE_CAMEL=3
# Get the foreground colour of a style.
get colour StyleGetFore=2481(int style,)
diff --git a/src/EditView.cxx b/src/EditView.cxx
index 5372e3abd..e6963e56a 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -389,9 +389,17 @@ void EditView::LayoutLine(const EditModel &model, int line, Surface *surface, co
else if (vstyle.styles[ll->styles[numCharsInLine]].caseForce == Style::caseLower)
allSame = allSame &&
(ll->chars[numCharsInLine] == static_cast<char>(tolower(chDoc)));
- else // Style::caseUpper
+ else if (vstyle.styles[ll->styles[numCharsInLine]].caseForce == Style::caseUpper)
allSame = allSame &&
(ll->chars[numCharsInLine] == static_cast<char>(toupper(chDoc)));
+ else { // Style::caseCamel
+ if ((model.pdoc->WordCharClass(ll->chars[numCharsInLine]) == CharClassify::ccWord) &&
+ ((numCharsInLine == 0) || (model.pdoc->WordCharClass(ll->chars[numCharsInLine - 1]) != CharClassify::ccWord))) {
+ allSame = allSame && (ll->chars[numCharsInLine] == static_cast<char>(toupper(chDoc)));
+ } else {
+ allSame = allSame && (ll->chars[numCharsInLine] == static_cast<char>(tolower(chDoc)));
+ }
+ }
numCharsInLine++;
}
allSame = allSame && (ll->styles[numCharsInLine] == styleByte); // For eolFilled
@@ -434,6 +442,14 @@ void EditView::LayoutLine(const EditModel &model, int line, Surface *surface, co
ll->chars[charInLine] = static_cast<char>(toupper(chDoc));
else if (vstyle.styles[ll->styles[charInLine]].caseForce == Style::caseLower)
ll->chars[charInLine] = static_cast<char>(tolower(chDoc));
+ else if (vstyle.styles[ll->styles[charInLine]].caseForce == Style::caseCamel) {
+ if ((model.pdoc->WordCharClass(ll->chars[charInLine]) == CharClassify::ccWord) &&
+ ((charInLine == 0) || (model.pdoc->WordCharClass(ll->chars[charInLine - 1]) != CharClassify::ccWord))) {
+ ll->chars[charInLine] = static_cast<char>(toupper(chDoc));
+ } else {
+ ll->chars[charInLine] = static_cast<char>(tolower(chDoc));
+ }
+ }
}
}
ll->xHighlightGuide = 0;
diff --git a/src/Style.h b/src/Style.h
index 411b11a08..cc9148af6 100644
--- a/src/Style.h
+++ b/src/Style.h
@@ -61,7 +61,7 @@ public:
ColourDesired back;
bool eolFilled;
bool underline;
- enum ecaseForced {caseMixed, caseUpper, caseLower};
+ enum ecaseForced {caseMixed, caseUpper, caseLower, caseCamel};
ecaseForced caseForce;
bool visible;
bool changeable;