From 06d4c2dbb41a80c7ea3aab4e92753dd431c5d121 Mon Sep 17 00:00:00 2001 From: cxl Date: Mon, 24 Nov 2008 09:34:51 +0000 Subject: [PATCH] A++ fix (Alt+I not working) git-svn-id: svn://ultimatepp.org/upp/trunk@670 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/ide/Assist.cpp | 6 ++++-- uppsrc/ide/Goto.cpp | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/uppsrc/ide/Assist.cpp b/uppsrc/ide/Assist.cpp index d106c490f..b60e2c93a 100644 --- a/uppsrc/ide/Assist.cpp +++ b/uppsrc/ide/Assist.cpp @@ -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; } diff --git a/uppsrc/ide/Goto.cpp b/uppsrc/ide/Goto.cpp index a40b4a7d7..b422887da 100644 --- a/uppsrc/ide/Goto.cpp +++ b/uppsrc/ide/Goto.cpp @@ -208,6 +208,7 @@ void AssistEditor::SwapSContext(Parser& p) else for(;;) { int c = Ch(i); + DDUMP((char)c); if(c == '{') { i++; break;