diff options
| author | nyamatongwe <unknown> | 2010-05-18 01:11:30 +0000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2010-05-18 01:11:30 +0000 | 
| commit | 1af558c6da91cbbe669665e5a70cca06febaa0cd (patch) | |
| tree | 126832ebf970e58b4950fec10d0e7a2a878a4dff /src | |
| parent | 414acce48c0cbb50cb472a2126761ec552d00e06 (diff) | |
| download | scintilla-mirror-1af558c6da91cbbe669665e5a70cca06febaa0cd.tar.gz | |
Fix for bug #3002874 make Django template highlighting work also within
Javascript and other script regions of html files.
Diffstat (limited to 'src')
| -rw-r--r-- | src/LexHTML.cxx | 6 | 
1 files changed, 4 insertions, 2 deletions
| diff --git a/src/LexHTML.cxx b/src/LexHTML.cxx index a3d883ab8..9bec3a214 100644 --- a/src/LexHTML.cxx +++ b/src/LexHTML.cxx @@ -642,6 +642,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty  	if (inScriptType == eNonHtmlScript && state == SCE_H_COMMENT) {  		scriptLanguage = eScriptComment;  	} +	script_type beforeLanguage = ScriptOfState(beforePreProc);  	// property fold.html  	//	Folding is turned on or off for HTML and XML files with this option. @@ -948,7 +949,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty  		}  		// handle the start Django template code -		else if (isDjango && scriptLanguage == eScriptNone && (ch == '{' && (chNext == '%' ||  chNext == '{'))) { +		else if (isDjango && scriptLanguage != eScriptPython && (ch == '{' && (chNext == '%' ||  chNext == '{'))) {  			if (chNext == '%')  				strcpy(djangoBlockType, "%");  			else @@ -963,6 +964,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty  			i += 1;  			visibleChars += 1;  			state = SCE_HP_START; +			beforeLanguage = scriptLanguage;  			scriptLanguage = eScriptPython;  			styler.ColourTo(i, SCE_H_ASP);  			if (foldHTMLPreprocessor && chNext == '%') @@ -1096,7 +1098,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty  			if (foldHTMLPreprocessor) {  				levelCurrent--;  			} -			scriptLanguage = eScriptNone; +			scriptLanguage = beforeLanguage;  			continue;  		} | 
