Hopefully fix #1718532 - 'Crashes when open a special file';

backported from Scintilla 1.73.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1532 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2007-05-14 15:53:23 +00:00
parent f8eddeb70a
commit db0bd302b3
2 changed files with 9 additions and 3 deletions

View File

@ -5,6 +5,9 @@
Reorder Haskell, O-Matrix, VHDL filetypes.
* src/document.c:
Fix removing indent spaces after switching back to tab indenting.
* scintilla/LexHTML.cxx:
Hopefully fix #1718532 - 'Crashes when open a special file';
backported from Scintilla 1.73.
2007-05-12 Nick Treleaven <nick.treleaven@btinternet.com>

View File

@ -863,7 +863,9 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
styler.ColourTo(i - 1, StateToPrint);
state = SCE_H_SGML_SIMPLESTRING;
} else if ((ch == '-') && (chPrev == '-')) {
styler.ColourTo(i - 2, StateToPrint);
if (static_cast<int>(styler.GetStartSegment()) <= (i - 2)) {
styler.ColourTo(i - 2, StateToPrint);
}
state = SCE_H_SGML_COMMENT;
} else if (isascii(ch) && isalpha(ch) && (chPrev == '%')) {
styler.ColourTo(i - 2, StateToPrint);
@ -1600,8 +1602,9 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
styler.ColourTo(i - 1, StateToPrint);
state = SCE_HPHP_HSTRING_VARIABLE;
} else if (styler.Match(i, phpStringDelimiter)) {
if (strlen(phpStringDelimiter) > 1)
i += strlen(phpStringDelimiter) - 1;
const int psdLength = strlen(phpStringDelimiter);
if ((psdLength > 1) && ((i + psdLength) < lengthDoc))
i += psdLength - 1;
styler.ColourTo(i, StateToPrint);
state = SCE_HPHP_DEFAULT;
}