CodeEditor: Thousands separator

git-svn-id: svn://ultimatepp.org/upp/trunk@6409 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2013-10-11 10:29:34 +00:00
commit 2da4535f7c
6 changed files with 44 additions and 13 deletions

View file

@ -162,9 +162,10 @@ void LineEdit::Paint0(Draw& w) {
else {
bool cjk = IsCJKIdeograph(txt[q]);
int p = q + 1;
while(p < len && h == hl[p] && !hl[p].flags && txt[p] != '\t'
&& txt[p] != ' ' && IsCJKIdeograph(txt[p]) == cjk && p - q < 128)
p++;
if(!hl[q].flags)
while(p < len && h == hl[p] && !hl[p].flags && txt[p] != '\t'
&& txt[p] != ' ' && IsCJKIdeograph(txt[p]) == cjk && p - q < 128)
p++;
int l = p - q;
int ll = cjk ? 2 * l : l;
LLOG("Highlight -> paper[" << q << "] = " << h.paper);
@ -181,13 +182,14 @@ void LineEdit::Paint0(Draw& w) {
dx2.At(l, 2 * fsz.cx);
else
dx.At(l, fsz.cx);
if(h.flags && fsz.cx > 4 && h.font.GetDescent() > 2) {
if((h.flags & (COMMA_L|COMMA_R)) && fsz.cx > 4 && h.font.GetDescent() > 2) {
if((h.flags & COMMA_L))
w.DrawRect(x + fsz.cx - 1, y + fascent + 1, 1, 2, h.flag_color);
if((h.flags & COMMA_R))
w.DrawRect(x, y + fascent, 1, 2, h.flag_color);
}
w.DrawText(x, y + fascent - h.font.GetAscent(),
w.DrawText(x + (h.flags & SHIFT_L ? -1 : h.flags & SHIFT_R ? 1 : 0),
y + fascent - h.font.GetAscent(),
~txt + q, h.font, h.ink, l, cjk ? dx2 : dx);
}
q = p;