ide: Highlighting of numbers improved

git-svn-id: svn://ultimatepp.org/upp/trunk@7815 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-10-23 06:52:11 +00:00
parent b7403bfbdb
commit c3bc80bfd6
3 changed files with 49 additions and 41 deletions

View file

@ -21,15 +21,8 @@ void LogSyntax::Highlight(const wchar *s, const wchar *end, HighlightOutput& hls
if(s + 3 <= end && (Is3(s, '-') || Is3(s, '*') || Is3(s, '=') || Is3(s, '+') ||
Is3(s, '#') || Is3(s, ':') || Is3(s, '%') || Is3(s, '$')))
sep_line = true;
if(IsDigit(c)) {
bool fp = false;
while(s < end && IsDigit(*s) || *s == '.' || *s == 'e') {
fp = fp || *s == '.' || *s == 'e';
s++;
}
hls.Put(int(s - s0), hl_style[(IsAlpha(*s) || *s == '_') && (IsAlNum(s[1]) || s[1] == '_') ? INK_NORMAL // More likely a hexdump or something
: fp ? INK_CONST_FLOAT : INK_CONST_INT]);
}
if(IsDigit(c))
s = HighlightNumber(hls, s, thousands_separator, false, false);
else
if(c == '\'' || c == '\"') {
s++;