aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <unknown>2000-07-18 12:30:14 +0000
committernyamatongwe <unknown>2000-07-18 12:30:14 +0000
commit202d2f734198df6a6dd126122990004ee0e54e5a (patch)
treebac9b138ef2dae6b3d4c1e4c2ce4b56477dbd6dc /src
parentc8b861658ba73c63cc01f40bac303307d0080184 (diff)
downloadscintilla-mirror-202d2f734198df6a6dd126122990004ee0e54e5a.tar.gz
Updates from Steve to make Python strings and incremental styling work.
Diffstat (limited to 'src')
-rw-r--r--src/LexHTML.cxx24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/LexHTML.cxx b/src/LexHTML.cxx
index 26b9111b7..3c3370ec2 100644
--- a/src/LexHTML.cxx
+++ b/src/LexHTML.cxx
@@ -80,6 +80,23 @@ static int statePrintForState(int state, int inScriptType)
return StateToPrint;
}
+static int stateForPrintState(int StateToPrint)
+{
+ int state;
+
+ if ((StateToPrint >= SCE_HPA_START) && (StateToPrint <= SCE_HPA_IDENTIFIER)) {
+ state = StateToPrint - SCE_HA_PYTHON;
+ } else if ((StateToPrint >= SCE_HBA_START) && (StateToPrint <= SCE_HBA_STRINGEOL)) {
+ state = StateToPrint - SCE_HA_VBS;
+ } else if ((StateToPrint >= SCE_HJA_START) && (StateToPrint <= SCE_HJA_STRINGEOL)) {
+ state = StateToPrint - SCE_HA_JS;
+ } else {
+ state = StateToPrint;
+ }
+
+ return state;
+}
+
static void classifyAttribHTML(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) {
bool wordIsNumber = isdigit(styler[start]) || (styler[start] == '.') ||
(styler[start] == '-') || (styler[start] == '#');
@@ -270,8 +287,8 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
char prevWord[200];
prevWord[0] = '\0';
int scriptLanguage = eScriptJS;
- int state = initStyle;
- int StateToPrint = state;
+ int StateToPrint = initStyle;
+ int state = stateForPrintState(StateToPrint);
// If inside a tag, it may be a script tag, so reread from the start to ensure any language tags are seen
if (InTagState(state)) {
@@ -791,7 +808,8 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
chPrev = ' ';
chNext = styler.SafeGetCharAt(i + 1);
} else {
- state = statePrintForState(SCE_HP_STRING,inScriptType);
+// state = statePrintForState(SCE_HP_STRING,inScriptType);
+ state = SCE_HP_STRING;
}
} else if (ch == '\'') {
styler.ColourTo(i - 1, StateToPrint);