A++ fix (Alt+I not working)

git-svn-id: svn://ultimatepp.org/upp/trunk@670 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2008-11-24 09:34:51 +00:00
parent 5a0bedd65a
commit 06d4c2dbb4
2 changed files with 5 additions and 2 deletions

View file

@ -133,12 +133,14 @@ void AssistEditor::DirtyFrom(int line)
int AssistEditor::Ch(int i)
{
if(i >= 0 && i < GetLength()) {
if(i < cachedpos || i - cachedpos >= cachedline.GetCount()) {
if(i < cachedpos || i - cachedpos > cachedline.GetCount()) {
cachedln = GetLine(i);
cachedline = GetWLine(cachedln);
cachedpos = GetPos(cachedln);
DDUMP(cachedline);
}
return cachedline[i - cachedpos];
i -= cachedpos;
return i < cachedline.GetCount() ? cachedline[i] : '\n';
}
return 0;
}

View file

@ -208,6 +208,7 @@ void AssistEditor::SwapSContext(Parser& p)
else
for(;;) {
int c = Ch(i);
DDUMP((char)c);
if(c == '{') {
i++;
break;