diff options
| author | nyamatongwe <devnull@localhost> | 2000-07-18 12:30:14 +0000 | 
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2000-07-18 12:30:14 +0000 | 
| commit | 6caf2a4e351b558c80418e197ead04034c8d980c (patch) | |
| tree | bac9b138ef2dae6b3d4c1e4c2ce4b56477dbd6dc /src/LexHTML.cxx | |
| parent | dee236ce71b0ce4795a6d2773f47b4075c283d8c (diff) | |
| download | scintilla-mirror-6caf2a4e351b558c80418e197ead04034c8d980c.tar.gz | |
Updates from Steve to make Python strings and incremental styling work.
Diffstat (limited to 'src/LexHTML.cxx')
| -rw-r--r-- | src/LexHTML.cxx | 24 | 
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); | 
