mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-24 14:22:40 -06:00
CodeEditor: FP number highlighting improved
git-svn-id: svn://ultimatepp.org/upp/trunk@8223 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
c25b802a76
commit
2f09a95c73
2 changed files with 11 additions and 10 deletions
|
|
@ -55,22 +55,23 @@ const wchar *HighlightNumber(HighlightOutput& hls, const wchar *p, bool ts, bool
|
|||
{
|
||||
int c = octal ? HighlightSetup::INK_CONST_OCT : HighlightSetup::INK_CONST_INT;
|
||||
const wchar *t = p;
|
||||
bool isDot, isFloat = false;
|
||||
while(IsDigit(*p)) p++;
|
||||
int fixdigits = int(p - t);
|
||||
if(*p == '.' || (*p == 'e' || *p == 'E') && !css) {
|
||||
if(*p == '.')
|
||||
isDot = true;
|
||||
if(*p == '.') {
|
||||
c = HighlightSetup::INK_CONST_FLOAT;
|
||||
p++;
|
||||
if(*p == '-')
|
||||
p++;
|
||||
}
|
||||
while((IsDigit(*p) || *p == 'e' || *p == '-' || (isDot && *p == 'f')) && (isFloat == false)) {
|
||||
if(*p == 'f')
|
||||
isFloat = true;
|
||||
while(IsDigit(*p)) p++;
|
||||
if(*p == 'e' || *p == 'E') {
|
||||
c = HighlightSetup::INK_CONST_FLOAT;
|
||||
p++;
|
||||
}
|
||||
if(c == HighlightSetup::INK_CONST_FLOAT) {
|
||||
p += *p == '-' || *p == '+';
|
||||
while(IsDigit(*p)) p++;
|
||||
if(*p == 'f')
|
||||
p++;
|
||||
}
|
||||
if(c == HighlightSetup::INK_CONST_OCT && p - t == 1)
|
||||
c = HighlightSetup::INK_CONST_INT;
|
||||
int n = int(p - t);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#define _CodeEditor_icpp_init_stub
|
||||
#include "CtrlLib/init"
|
||||
#include "plugin/pcre/init"
|
||||
#define BLITZ_INDEX__ F9714522c143037334ef92752f80fbeaa
|
||||
#define BLITZ_INDEX__ F97a09d04ab17001c0c60ffb6219ac958
|
||||
#include "CRegister.icpp"
|
||||
#undef BLITZ_INDEX__
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue