summaryrefslogtreecommitdiffstats
path: root/scintilla/lexers/LexHTML.cxx
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2011-03-27 11:36:33 +0000
committerXhmikosR <xhmikosr@users.sourceforge.net>2011-03-27 11:36:33 +0000
commitd1fcb5aa3c6dcb88a984da49731e0102cf0cf36a (patch)
treef8e213fc06291668944dd19bac750eeca3c70a2b /scintilla/lexers/LexHTML.cxx
parentc9566a6466c0684d0bc6a9b8f7693c8ce14c2e38 (diff)
downloadnotepad2-mod-d1fcb5aa3c6dcb88a984da49731e0102cf0cf36a.zip
notepad2-mod-d1fcb5aa3c6dcb88a984da49731e0102cf0cf36a.tar.gz
notepad2-mod-d1fcb5aa3c6dcb88a984da49731e0102cf0cf36a.tar.bz2
update scintilla
git-svn-id: https://notepad2-mod.googlecode.com/svn/trunk@450 28bd50df-7adb-d945-0439-6e466c6a13cc
Diffstat (limited to 'scintilla/lexers/LexHTML.cxx')
-rw-r--r--scintilla/lexers/LexHTML.cxx25
1 files changed, 13 insertions, 12 deletions
diff --git a/scintilla/lexers/LexHTML.cxx b/scintilla/lexers/LexHTML.cxx
index 75133f1..a456612 100644
--- a/scintilla/lexers/LexHTML.cxx
+++ b/scintilla/lexers/LexHTML.cxx
@@ -318,19 +318,19 @@ static int classifyTagHTML(unsigned int start, unsigned int end,
static void classifyWordHTJS(unsigned int start, unsigned int end,
WordList &keywords, Accessor &styler, script_mode inScriptType) {
+ char s[30 + 1];
+ unsigned int i = 0;
+ for (; i < end - start + 1 && i < 30; i++) {
+ s[i] = styler[start + i];
+ }
+ s[i] = '\0';
+
char chAttr = SCE_HJ_WORD;
- bool wordIsNumber = IsADigit(styler[start]) || (styler[start] == '.');
- if (wordIsNumber)
+ bool wordIsNumber = IsADigit(s[0]) || ((s[0] == '.') && IsADigit(s[1]));
+ if (wordIsNumber) {
chAttr = SCE_HJ_NUMBER;
- else {
- char s[30 + 1];
- unsigned int i = 0;
- for (; i < end - start + 1 && i < 30; i++) {
- s[i] = styler[start + i];
- }
- s[i] = '\0';
- if (keywords.InList(s))
- chAttr = SCE_HJ_KEYWORD;
+ } else if (keywords.InList(s)) {
+ chAttr = SCE_HJ_KEYWORD;
}
styler.ColourTo(end, statePrintForState(chAttr, inScriptType));
}
@@ -883,6 +883,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
(ch == '<') &&
(chNext == '?') &&
!IsScriptCommentState(state) ) {
+ beforeLanguage = scriptLanguage;
scriptLanguage = segIsScriptingIndicator(styler, i + 2, i + 6, eScriptPHP);
if (scriptLanguage != eScriptPHP && isStringState(state)) continue;
styler.ColourTo(i - 1, StateToPrint);
@@ -1154,7 +1155,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
if (foldHTMLPreprocessor && (scriptLanguage != eScriptXML)) {
levelCurrent--;
}
- scriptLanguage = eScriptNone;
+ scriptLanguage = beforeLanguage;
continue;
}
/////////////////////////////////////