diff options
author | nyamatongwe <unknown> | 2010-11-03 10:05:02 +1100 |
---|---|---|
committer | nyamatongwe <unknown> | 2010-11-03 10:05:02 +1100 |
commit | 39b9068991076a101840957f1dcf32331ab57eb1 (patch) | |
tree | 9dcbf35744afed86ad07620a2b5eec816d874a4a /lexers/LexHTML.cxx | |
parent | a6be196590ffec5583535c4d49be52d8c62d72e8 (diff) | |
download | scintilla-mirror-39b9068991076a101840957f1dcf32331ab57eb1.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--; |