From fd538bb1c91411eb766ae4aeec910c97f911f6ff Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Thu, 3 Mar 2005 00:27:27 +0000 Subject: Fix from Iago Rubio to make the text start a comment but not end it. --- src/LexHTML.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/LexHTML.cxx') diff --git a/src/LexHTML.cxx b/src/LexHTML.cxx index 0b16da2b0..e1406234c 100644 --- a/src/LexHTML.cxx +++ b/src/LexHTML.cxx @@ -719,17 +719,18 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty ///////////////////////////////////// // handle the start of SGML language (DTD) else if (((scriptLanguage == eScriptNone) || (scriptLanguage == eScriptXML)) && - (chPrev == '<') && - (ch == '!') && - (StateToPrint != SCE_H_CDATA) && + (chPrev == '<') && + (ch == '!') && + (StateToPrint != SCE_H_CDATA) && (!IsCommentState(StateToPrint)) && (!IsScriptCommentState(StateToPrint)) ) { beforePreProc = state; styler.ColourTo(i - 2, StateToPrint); if ((chNext == '-') && (chNext2 == '-')) { state = SCE_H_COMMENT; // wait for a pending command - } - else if (isWordCdata(i + 1, i + 7, styler)) { + styler.ColourTo(i + 2, SCE_H_COMMENT); + i += 2; // follow styling after the -- + } else if (isWordCdata(i + 1, i + 7, styler)) { state = SCE_H_CDATA; } else { styler.ColourTo(i, SCE_H_SGML_DEFAULT); //