From 1e71f4199ad8081b665ccdceafbec6d960ca1b6e Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Fri, 16 Feb 2018 17:22:10 +0100 Subject: [PATCH] + fix: small datatype correction ... --- scintilla/lexers/LexRegistry.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scintilla/lexers/LexRegistry.cxx b/scintilla/lexers/LexRegistry.cxx index 0c14318f6..d2a37740a 100644 --- a/scintilla/lexers/LexRegistry.cxx +++ b/scintilla/lexers/LexRegistry.cxx @@ -64,6 +64,10 @@ class LexerRegistry : public DefaultLexer { return (state == SCE_REG_ADDEDKEY || state == SCE_REG_DELETEDKEY); } + static bool IsByteValue(int value) { + return ((value >= 0) && (value < 256)); + } + static bool AtValueType(LexAccessor &styler, Sci_Position start) { Sci_Position i = 0; while (i < 10) { @@ -337,7 +341,7 @@ void SCI_METHOD LexerRegistry::Lex(Sci_PositionU startPos, if (wordStart && AtValueType(styler, currPos)) { context.SetState(SCE_REG_VALUETYPE); } - } else if (isxdigit(context.ch & 0xFF) && highlight) { + } else if (IsByteValue(context.ch) && isxdigit(context.ch & 0xFF) && highlight) { context.SetState(SCE_REG_HEXDIGIT); } highlight = (context.ch == '@') ? true : highlight;