ide: ContextGoto fixed issue with local variables

git-svn-id: svn://ultimatepp.org/upp/trunk@8762 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2015-07-28 16:52:36 +00:00
parent a10e7166bc
commit c594dc79aa
2 changed files with 19 additions and 17 deletions

View file

@ -386,16 +386,16 @@ void LineEdit::Paint0(Draw& w) {
}
else
if(h.chr == ' ') {
LLOG("Highlight -> space[" << q << "] paper = " << h.paper);
if(pass == 0 && x >= -fsz.cy) {
w.DrawRect(x, y, fsz.cx, fsz.cy, h.paper);
if(showspaces && h.paper != SColorHighlight && q < tx.GetLength())
w.DrawRect(x + fsz.cx / 2, y + fsz.cy / 2, 2, 2, showcolor);
if(bordercolumn > 0 && bordercolumn >= gp && bordercolumn < gp + 1)
w.DrawRect((bordercolumn - sc.x) * fsz.cx, y, 1, fsz.cy, bordercolor);
}
q++;
gp++;
LLOG("Highlight -> space[" << q << "] paper = " << h.paper);
if(pass == 0 && x >= -fsz.cy) {
w.DrawRect(x, y, fsz.cx, fsz.cy, h.paper);
if(showspaces && h.paper != SColorHighlight && q < tx.GetLength())
w.DrawRect(x + fsz.cx / 2, y + fsz.cy / 2, 2, 2, showcolor);
if(bordercolumn > 0 && bordercolumn >= gp && bordercolumn < gp + 1)
w.DrawRect((bordercolumn - sc.x) * fsz.cx, y, 1, fsz.cy, bordercolor);
}
q++;
gp++;
}
else {
bool cjk = IsCJKIdeograph(h.chr);
@ -423,17 +423,19 @@ void LineEdit::Paint0(Draw& w) {
int gpx = gp * fsz.cx - scx;
w.DrawRect(gpx, y, sz.cx - gpx, fsz.cy,
!rectsel && sell <= len && len < selh ? color[PAPER_SELECTED]
: (do_highlight ? hl.Top() : ih).paper);
: (do_highlight ? hl.Top() : ih).paper);
if(bordercolumn > 0 && bordercolumn >= gp)
w.DrawRect((bordercolumn - sc.x) * fsz.cx, y, 1, fsz.cy, bordercolor);
}
if(pass == 0 && showlines) {
int yy = 2 * fsz.cy / 3;
int x = gp * fsz.cx - scx;
w.DrawRect(x, y + yy, fsz.cx / 2, 1, showcolor);
if(fsz.cx > 2)
w.DrawRect(x + 1, y + yy - 1, 1, 3, showcolor);
w.DrawRect(x + fsz.cx / 2, y + yy / 2, 1, yy - yy / 2, showcolor);
w.DrawRect(x, y + yy, fsz.cx / 2, 1, showcolor);
if(fsz.cx > 2)
w.DrawRect(x + 1, y + yy - 1, 1, 3, showcolor);
if(fsz.cx > 5)
w.DrawRect(x + 2, y + yy - 2, 1, 5, showcolor);
w.DrawRect(x + fsz.cx / 2, y + yy / 2, 1, yy - yy / 2, showcolor);
}
if(pass == 0 && !IsNull(hline) && sell == selh && i == cursorline) {
w.DrawRect(0, y, sz.cx, 1, hline);

View file

@ -176,7 +176,7 @@ void Ide::ContextGoto0(int pos)
ci++;
break;
}
if(c == '}' || c == 0)
if(c == '}' || c == 0 || c == ';')
break;
ci++;
}
@ -292,7 +292,7 @@ void Ide::ContextGoto0(int pos)
todo.Append(f.GetBases());
}
}
if(scope.GetCount() == 0) {
if(xp.GetCount() == 0) {
q = parser.local.Find(id);
if(q >= 0) { // Try locals
AddHistory();