From 97fb82a021bdbd224a1a6ca089780fb8d826cbe0 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Wed, 28 Feb 2007 22:32:40 +0000 Subject: Fix bug #1670851 by checking that not trying to style backwards. --- src/LexHTML.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/LexHTML.cxx b/src/LexHTML.cxx index b4f471631..a89ce149a 100644 --- a/src/LexHTML.cxx +++ b/src/LexHTML.cxx @@ -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(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); -- cgit v1.2.3