diff options
| author | nyamatongwe <devnull@localhost> | 2011-04-06 09:52:24 +1000 | 
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2011-04-06 09:52:24 +1000 | 
| commit | 5f8a4e204bec27ecbb35debac51ebc4bcd031390 (patch) | |
| tree | 03d5e96f3c1a1c9b1bdd6a833dadd138f277079c | |
| parent | 826a491dbe23e1816aafcdf3cc46b6c6a374c7f8 (diff) | |
| download | scintilla-mirror-5f8a4e204bec27ecbb35debac51ebc4bcd031390.tar.gz | |
Django in HTML lexer recognizes {# #} comments. Bug #3013798.
From Stephan R.A. Deibel at Wingware.
| -rw-r--r-- | lexers/LexHTML.cxx | 31 | 
1 files changed, 31 insertions, 0 deletions
| diff --git a/lexers/LexHTML.cxx b/lexers/LexHTML.cxx index ae4b74c7d..fe681cc9d 100644 --- a/lexers/LexHTML.cxx +++ b/lexers/LexHTML.cxx @@ -955,6 +955,37 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty  			continue;  		} +		// handle the start/end of Django comment +		else if (isDjango && state != SCE_H_COMMENT && (ch == '{' && chNext == '#')) { +			styler.ColourTo(i - 1, StateToPrint); +			beforePreProc = state; +			beforeLanguage = scriptLanguage; +			if (inScriptType == eNonHtmlScript) +				inScriptType = eNonHtmlScriptPreProc; +			else +				inScriptType = eNonHtmlPreProc; +			i += 1; +			visibleChars += 1; +			scriptLanguage = eScriptComment; +			state = SCE_H_COMMENT; +			styler.ColourTo(i, SCE_H_ASP); +			ch = static_cast<unsigned char>(styler.SafeGetCharAt(i)); +			continue; +		} +		else if (isDjango && state == SCE_H_COMMENT && (ch == '#' && chNext == '}')) { +			styler.ColourTo(i - 1, StateToPrint); +			i += 1; +			visibleChars += 1; +			styler.ColourTo(i, SCE_H_ASP); +			state = beforePreProc; +			if (inScriptType == eNonHtmlScriptPreProc) +				inScriptType = eNonHtmlScript; +			else +				inScriptType = eHtml; +			scriptLanguage = beforeLanguage; +			continue; +		} +  		// handle the start Django template code  		else if (isDjango && scriptLanguage != eScriptPython && (ch == '{' && (chNext == '%' ||  chNext == '{'))) {  			if (chNext == '%') | 
