mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 06:05:58 -06:00
ide: error handling improvements...
git-svn-id: svn://ultimatepp.org/upp/trunk@7453 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
f0dfb73e21
commit
e1bbcb4ece
4 changed files with 17 additions and 5 deletions
|
|
@ -263,6 +263,7 @@ void CSyntax::InitKeywords()
|
|||
"BIT", "BIT_ARRAY", "BIT_", "BIT_ARRAY_",
|
||||
"BOOL", "BOOL_ARRAY", "BOOL_", "BOOL_ARRAY_",
|
||||
"INT", "INT_ARRAY", "INT_", "INT_ARRAY_",
|
||||
"INT64", "INT64_ARRAY", "INT64_", "INT64_ARRAY_",
|
||||
"DOUBLE", "DOUBLE_ARRAY", "DOUBLE_", "DOUBLE_ARRAY_",
|
||||
"DATE", "DATE_ARRAY", "DATE_", "DATE_ARRAY_",
|
||||
"DATETIME", "DATETIME_ARRAY", "DATETIME_", "DATETIME_ARRAY_",
|
||||
|
|
|
|||
|
|
@ -56,7 +56,16 @@ void Console::Append(const String& s) {
|
|||
SetEditable();
|
||||
MoveTextEnd();
|
||||
WString t = Filter(FromSystemCharset(s), sAppf).ToWString();
|
||||
int l0 = GetLineCount() - 1;
|
||||
if(IsRunning())
|
||||
for(const wchar *q = t; *q; q++) {
|
||||
if(*q == '\n') {
|
||||
WhenLine(line.ToString());
|
||||
line.Clear();
|
||||
}
|
||||
else
|
||||
if((byte)*q >= ' ')
|
||||
line.Cat(*q);
|
||||
}
|
||||
int mg = sb.GetReducedViewSize().cx / GetFont().Info().GetAveWidth();
|
||||
if(wrap_text && mg > 4) {
|
||||
int x = GetColumnLine(GetCursor()).x;
|
||||
|
|
@ -82,8 +91,6 @@ void Console::Append(const String& s) {
|
|||
SetEditPos(p);
|
||||
SetSelection(l, h);
|
||||
}
|
||||
while(l0 >= 0 && l0 < GetLineCount() - 1)
|
||||
WhenLine(GetUtf8Line(l0++));
|
||||
}
|
||||
|
||||
bool Console::Key(dword key, int count) {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ bool Ide::FindLineError(const String& ln, FindLineErrorCache& cache, ErrorInfo&
|
|||
VectorMap<String, String> bm = GetMethodVars(method);
|
||||
bool is_java = (bm.Get("BUILDER", Null) == "JDK");
|
||||
const char *s = ln;
|
||||
f.kind = ln.Find("error", 0) > 0 ? 1 : (ln.Find("warning", 0) > 0 ? 2 : ln.Find("note") > 0 ? 3 : 4);
|
||||
while(*s == ' ' || *s == '\t')
|
||||
s++;
|
||||
for(; s < ln.End(); s++) {
|
||||
|
|
@ -72,6 +71,10 @@ bool Ide::FindLineError(const String& ln, FindLineErrorCache& cache, ErrorInfo&
|
|||
if(p.Char(':') && p.IsInt())
|
||||
f.linepos = p.ReadInt();
|
||||
const char *ms = p.GetPtr();
|
||||
int pos = ms - ~ln;
|
||||
f.kind = ln.Find("error", pos) > 0 ? 1 :
|
||||
ln.Find("warning", pos) > 0 ? 2 :
|
||||
ln.Find("note", pos) > 0 ? 3 : 4;
|
||||
const char *hs = ms;
|
||||
while(!IsLetter(*hs) && *hs)
|
||||
hs++;
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ protected:
|
|||
int console_lock;
|
||||
bool wrap_text;
|
||||
FrameBottom<EditString> input;
|
||||
WString line;
|
||||
|
||||
void CheckEndGroup();
|
||||
void FlushConsole();
|
||||
|
|
@ -112,7 +113,7 @@ public:
|
|||
int Flush();
|
||||
void Kill(int slot);
|
||||
void Kill();
|
||||
void ClearError() { error_keys.Clear(); }
|
||||
void ClearError() { error_keys.Clear(); line.Clear(); }
|
||||
Vector<String> PickErrors() { Vector<String> e = pick(error_keys); error_keys.Clear(); return pick(e); }
|
||||
void Wait(int slot);
|
||||
bool Wait();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue