diff options
| author | nyamatongwe <devnull@localhost> | 2010-11-03 10:05:02 +1100 | 
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2010-11-03 10:05:02 +1100 | 
| commit | 3ca5d1a312775f73f9bee83ac8d41a37ec0e5927 (patch) | |
| tree | 521e3fcce066af03ea5ba2468f53d2a010704bd0 /lexers/LexHTML.cxx | |
| parent | 72e65a52fa9a111efdcb107b198e694ea4ce65a9 (diff) | |
| download | scintilla-mirror-3ca5d1a312775f73f9bee83ac8d41a37ec0e5927.tar.gz | |
Support for #region for PHP. Feature #3101624.
Diffstat (limited to 'lexers/LexHTML.cxx')
| -rw-r--r-- | lexers/LexHTML.cxx | 14 | 
1 files changed, 12 insertions, 2 deletions
| diff --git a/lexers/LexHTML.cxx b/lexers/LexHTML.cxx index e025c2b38..10db8eeb5 100644 --- a/lexers/LexHTML.cxx +++ b/lexers/LexHTML.cxx @@ -745,8 +745,18 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty  				if ((state != SCE_HPHP_COMMENT) && (state != SCE_HPHP_COMMENTLINE) && (state != SCE_HJ_COMMENT) && (state != SCE_HJ_COMMENTLINE) && (state != SCE_HJ_COMMENTDOC) && (!isStringState(state))) {  				//Platform::DebugPrintf("state=%d, StateToPrint=%d, initStyle=%d\n", state, StateToPrint, initStyle);  				//if ((state == SCE_HPHP_OPERATOR) || (state == SCE_HPHP_DEFAULT) || (state == SCE_HJ_SYMBOLS) || (state == SCE_HJ_START) || (state == SCE_HJ_DEFAULT)) { -					if ((ch == '{') || (ch == '}') || (foldComment && (ch == '/') && (chNext == '*'))) { -						levelCurrent += ((ch == '{') || (ch == '/')) ? 1 : -1; +					if (ch == '#') { +						int j = i + 1; +						while ((j < lengthDoc) && IsASpaceOrTab(styler.SafeGetCharAt(j))) { +							j++; +						} +						if (styler.Match(j, "region") || styler.Match(j, "if")) { +							levelCurrent++; +						} else if (styler.Match(j, "end")) { +							levelCurrent--; +						} +					} else if ((ch == '{') || (ch == '}') || (foldComment && (ch == '/') && (chNext == '*')) ) { +						levelCurrent += ((ch == '{') || (ch == '/') ) ? 1 : -1;  					}  				} else if (((state == SCE_HPHP_COMMENT) || (state == SCE_HJ_COMMENT)) && foldComment && (ch == '*') && (chNext == '/')) {  					levelCurrent--; | 
