aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2007-02-28 22:32:40 +0000
committernyamatongwe <devnull@localhost>2007-02-28 22:32:40 +0000
commit97fb82a021bdbd224a1a6ca089780fb8d826cbe0 (patch)
treed5083389775f09b198d0299bbc53beba227f473d /src
parentc67fa9076a6c6617bf2a7adea3aab78cbe8a8d5a (diff)
downloadscintilla-mirror-97fb82a021bdbd224a1a6ca089780fb8d826cbe0.tar.gz
Fix bug #1670851 by checking that not trying to style backwards.
Diffstat (limited to 'src')
-rw-r--r--src/LexHTML.cxx4
1 files changed, 3 insertions, 1 deletions
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<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);