aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <unknown>2008-06-02 10:44:09 +0000
committernyamatongwe <unknown>2008-06-02 10:44:09 +0000
commit704994d3fb35ef5e020eee786c0223416b375fc1 (patch)
tree8d2a6cbe722f23bb0ef4881502ac467e1335f750 /src
parent7886eb956f51f2e0afef6fe621ad41d5ba1ff657 (diff)
downloadscintilla-mirror-704994d3fb35ef5e020eee786c0223416b375fc1.tar.gz
Bug #1945003 corrects styling of PHP heredocs.
Diffstat (limited to 'src')
-rw-r--r--src/LexHTML.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/LexHTML.cxx b/src/LexHTML.cxx
index 89f82c676..659f13766 100644
--- a/src/LexHTML.cxx
+++ b/src/LexHTML.cxx
@@ -470,10 +470,15 @@ static bool isPHPStringState(int state) {
}
static int FindPhpStringDelimiter(char *phpStringDelimiter, const int phpStringDelimiterSize, int i, const int lengthDoc, Accessor &styler) {
- int j;
+ int j = i;
+ while (j < lengthDoc && (styler[j] != '\r' && styler[j] != '\n'))
+ j++;
+ phpStringDelimiter[0] = styler.SafeGetCharAt(j);
+ if ((phpStringDelimiter[0] == '\r') && (styler.SafeGetCharAt(j + 1) == '\n'))
+ phpStringDelimiter[0] = '\n';
+
while (i < lengthDoc && (styler[i] == ' ' || styler[i] == '\t'))
i++;
- phpStringDelimiter[0] = '\n';
for (j = i; j < lengthDoc && styler[j] != '\n' && styler[j] != '\r'; j++) {
if (j - i < phpStringDelimiterSize - 2)
phpStringDelimiter[j-i+1] = styler[j];
@@ -481,7 +486,7 @@ static int FindPhpStringDelimiter(char *phpStringDelimiter, const int phpStringD
i++;
}
phpStringDelimiter[j-i+1] = '\0';
- return j;
+ return j - 1;
}
static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],