Index: CodeEditor/CodeEditor.h =================================================================== --- CodeEditor/CodeEditor.h (revision 60) +++ CodeEditor/CodeEditor.h (working copy) @@ -25,7 +25,7 @@ int firstedited; int edited; - LineInfoRecord() { error = 0; edited = 0; } + LineInfoRecord() { error = 0; firstedited = 0; edited = 0; } }; typedef Array LineInfo; @@ -100,8 +100,8 @@ LineInfo GetLineInfo() const; void SetLineInfo(const LineInfo& li, int total); - LineInfoRem & GetLineInfoRem() { return li_removed; } - void SetLineInfoRem(LineInfoRem& li) { li_removed = li; } + LineInfoRem GetLineInfoRem() { return LineInfoRem(li_removed, 0); } + void SetLineInfoRem(LineInfoRem& li) { li_removed <<= li; } int GetLineNo(int lineno) const; int GetNoLine(int line) const; @@ -408,8 +408,8 @@ LineInfo GetLineInfo() const { return bar.GetLineInfo(); } void SetLineInfo(const LineInfo& lf); - LineInfoRem GetLineInfoRem() { return LineInfoRem(bar.GetLineInfoRem(), 0); } - void SetLineInfoRem(LineInfoRem& lf) { bar.SetLineInfoRem(LineInfoRem(lf, 0)); } + LineInfoRem GetLineInfoRem() { return LineInfoRem(bar.GetLineInfoRem()); } + void SetLineInfoRem(LineInfoRem& lf) { bar.SetLineInfoRem(lf); } double GetStatEditTime() const { return stat_edit_time; } void Renumber() { bar.Renumber(GetLineCount()); } void ClearBreakpoints() { bar.ClearBreakpoints(); } Index: CodeEditor/EditorBar.cpp =================================================================== --- CodeEditor/EditorBar.cpp (revision 60) +++ CodeEditor/EditorBar.cpp (working copy) @@ -125,11 +125,21 @@ int width = CodeEditorImg::Breakpoint().GetWidth() >> 1; if(edit) { - int age = (int)(log((double)(editor->GetUndoCount() + 1 - edit)) * 30); - w.DrawRect(0, y, width, fy, Blend(LtBlue, SColorLtFace(), min(220, age))); + int age = min(456, (int)(log((double)(editor->GetUndoCount() + 1 - edit)) * 50)); + Color c1, c2; + if(age < 256) { + c1 = Color(0, 150, 0); + c2 = Color(200, 255, 30); + } + else { + c1 = Color(200, 255, 30); + c2 = SColorLtFace(); + age -= 256; + } + w.DrawRect(0, y, width - 1, fy, Blend(c1, c2, age)); } if(err) - w.DrawRect(width, y, width, fy, err == 1 ? LtRed : (err == 2 ? Color(255, 175, 0) : Green)); + w.DrawRect(width, y, width - 1, fy, err == 1 ? Color(255, 40, 100) : (err == 2 ? Color(255, 175, 40) : Color(40, 175, 255))); } if(!b.IsEmpty()) @@ -184,12 +194,12 @@ li.InsertN(minmax(i, 0, li.GetCount()), max(count, 0)); if(editor->GetCheckEdited()) { if(editor->IsUndoOp() && li_removed.GetCount() >= count) { - for(int t = 0; t < count; t++) { - li.At(i + t).firstedited = li_removed[li_removed.GetCount() - count + t].firstedited; - li[i + t].edited = li_removed[li_removed.GetCount() - count + t].edited; + for(int t = 0; t < count + 1; t++) { + int p = li_removed.GetCount() - count - 1 + t; + li.At(i + t).firstedited = li_removed.At(p).firstedited; + li[i + t].edited = li_removed[p].edited; } li_removed.Drop(count); - SetEdited(i + count, 1); ignored_next_edit = true; } else { @@ -203,9 +213,9 @@ void EditorBar::RemoveLines(int i, int count) { if(editor->GetCheckEdited() && !editor->IsUndoOp()) { - for(int t = i - 1; t < i + count - 1; t++) { + for(int t = i - 1; t < i + count; t++) { LineInfoRemRecord& rm = li_removed.Add(); - rm.firstedited = li[t].firstedited; + rm.firstedited = li.At(t).firstedited; rm.edited = li[t].edited; } if(li.At(i + count - 1).firstedited) @@ -217,7 +227,6 @@ li.Remove(i, minmax(count, 0, li.GetCount() - i)); Refresh(); } - void EditorBar::ClearLines() { li.Clear(); li.Shrink(); @@ -354,7 +363,8 @@ void EditorBar::SetError(int ln, int err) { - li.At(ln).error = err; + if (!li.At(ln).error) + li[ln].error = err; } void EditorBar::ClearErrors(int line) Index: ide/Build.cpp =================================================================== --- ide/Build.cpp (revision 60) +++ ide/Build.cpp (working copy) @@ -525,7 +525,7 @@ bool Ide::Build(const Workspace& wspc, String mainparam, String outfile, bool clear_console) { - ClearErrorEditor(); + ClearLines(); BeginBuilding(true, clear_console); bool ok = true; if(wspc.GetCount()) { @@ -570,7 +570,7 @@ ProcessEvents(); ms = msecs(); } - SetErrorEditor(); + MarkLinesEditor(); } if(ok || !stoponerrors) ok = BuildPackage(wspc, 0, build_order.GetCount(), build_order.GetCount() + 1, @@ -578,7 +578,7 @@ } EndBuilding(ok); ReQualifyBrowserBase(); - SetErrorEditor(); + MarkLinesEditor(); return ok; } @@ -690,7 +690,7 @@ { if(editfile.IsEmpty()) return; - ClearErrorEditor(editfile); + ClearLinesEditor(); SwitchHeader(); BeginBuilding(); const Workspace& wspc = IdeWorkspace(); @@ -704,7 +704,7 @@ } onefile.Clear(); EndBuilding(ok); - SetErrorEditor(); + MarkLinesEditor(); } void Ide::Preprocess() { Index: ide/FindInFiles.cpp =================================================================== --- ide/FindInFiles.cpp (revision 60) +++ ide/FindInFiles.cpp (working copy) @@ -335,9 +335,9 @@ break; } console << Format("%d occurrence(s) have been found.\n", n); + MarkLinesEditor(); } } - SetErrorEditor(); } void Ide::FindString(bool back) Index: ide/ide.cpp =================================================================== --- ide/ide.cpp (revision 60) +++ ide/ide.cpp (working copy) @@ -476,34 +476,30 @@ if(FindLineError(l, *host)) return; } -void Ide::ClearErrorEditor() +void Ide::ClearLines() { if(!mark_lines) return; for(int i = 0; i < filedata.GetCount(); i++) { - ClearErrorEditor(filedata.GetKey(i)); + LineInfo li = editor.GetLineInfo(); + FileData& fd = filedata[i]; + editor.SetLineInfo(fd.lineinfo); + editor.ClearErrors(); + fd.lineinfo = editor.GetLineInfo(); + editor.SetLineInfo(li); } } -void Ide::ClearErrorEditor(String file) +void Ide::ClearLinesEditor() { if(!mark_lines) return; - if(file == editfile) - editor.ClearErrors(); - else { - LineInfo li = editor.GetLineInfo(); - FileData& fd = Filedata(file); - editor.SetLineInfo(fd.lineinfo); - editor.ClearErrors(); - fd.lineinfo = editor.GetLineInfo(); - editor.SetLineInfo(li); - } + editor.ClearErrors(); } -void Ide::SetErrorEditor() +void Ide::MarkLinesEditor() { if(!mark_lines) return; @@ -526,7 +522,8 @@ editor.SetLineInfo(fd.lineinfo); editor.SetError(lineno - 1, error); fd.lineinfo = editor.GetLineInfo(); - editor.SetLineInfo(li); + editor.SetLineInfo(li); + } } } Index: ide/ide.h =================================================================== --- ide/ide.h (revision 60) +++ ide/ide.h (working copy) @@ -848,9 +848,9 @@ bool FindLineError(int l, Host& host); bool FindLineError(String ln, Host& host, String& file, int& lineno, int& error); void FindError(); - void ClearErrorEditor(); - void ClearErrorEditor(String file); - void SetErrorEditor(); + void ClearLines(); + void ClearLinesEditor(); + void MarkLinesEditor(); void FindWildcard(); void FindFolder();