Index: CodeEditor/CodeEditor.cpp =================================================================== --- CodeEditor/CodeEditor.cpp (revision 58) +++ CodeEditor/CodeEditor.cpp (working copy) @@ -17,7 +17,7 @@ if(check_edited) { bar.ClearErrors(line); - bar.SetEdited(line, 1); + bar.SetEdited(line); bar.Refresh(); } } @@ -73,8 +73,8 @@ void CodeEditor::InsertLines(int line, int count) { bar.InsertLines(line, count); - for (int i = 0; i < count; i++) - bar.SetEdited(line + i, 1); + if (check_edited) + bar.SetEdited(line, count); } void CodeEditor::RemoveLines(int line, int count) { @@ -1009,6 +1009,8 @@ highlight_bracket_pos = 10; SetTimeCallback(-20, THISBACK(Periodic), TIMEID_PERIODIC); auto_enclose = false; + mark_lines = true; + check_edited = false; } CodeEditor::~CodeEditor() {} Index: CodeEditor/CodeEditor.h =================================================================== --- CodeEditor/CodeEditor.h (revision 58) +++ CodeEditor/CodeEditor.h (working copy) @@ -60,7 +60,8 @@ bool bingenabled; bool hilite_if_endif; bool line_numbers; - + int editage; + String& PointBreak(int& y); void sPaintImage(Draw& w, int y, int fy, const Image& img); @@ -79,7 +80,8 @@ String GetBreakpoint(int ln); void SetBreakpoint(int ln, const String& s); - void SetEdited(int ln, int edit); + void SetEdited(int ln, int count = 1); + void ClearMarkers(int ln = -1, int count = 1); void SetError(int ln, int err); void ClearErrors(int ln); @@ -222,6 +224,7 @@ Time last_key_time; bool auto_enclose; + bool mark_lines; bool check_edited; struct FindReplace : WithIDEFindReplaceLayout { @@ -403,6 +406,7 @@ void SetBreakpoint(int line, const String& b) { bar.SetBreakpoint(line, b); } void SetError(int line, int err) { bar.SetError(line, err); } void ClearErrors(int line = -1) { bar.ClearErrors(line); } + void ClearMarkers(int ln = -1, int count = 1) { bar.ClearMarkers(ln, count); } void GotoLine(int line); void EnableBreakpointing() { bar.EnableBreakpointing(true); } void DisableBreakpointing() { bar.EnableBreakpointing(false); } @@ -415,6 +419,8 @@ void IndentAmount(int ia) { indent_amount = ia; } void NoParenthesisIndent(bool b) { no_parenthesis_indent = b; } void LineNumbers(bool b) { bar.LineNumbers(b); } + void MarkLines(bool b) { mark_lines = b; } + bool GetMarkLines() { return mark_lines; } void AutoEnclose(bool b) { auto_enclose = b; } void HideBar() { bar.Hide(); } Index: CodeEditor/EditorBar.cpp =================================================================== --- CodeEditor/EditorBar.cpp (revision 58) +++ CodeEditor/EditorBar.cpp (working copy) @@ -119,15 +119,14 @@ } previf = nextif; } - if(edit > 0) { + + if (editor->GetMarkLines()) { int width = CodeEditorImg::Breakpoint().GetWidth() >> 1; - w.DrawRect(0, y, width, fy, LtBlue); + if(edit) + w.DrawRect(0, y, width, fy, Blend(LtBlue, SColorLtFace(), min(220, (editage - edit) >> 1))); + if(err) + w.DrawRect(width, y, width, fy, err == 1 ? LtRed : Color(255, 175, 0)); } - if(err > 0) { - int width = CodeEditorImg::Breakpoint().GetWidth() >> 1; - w.DrawRect(width, y, width, fy, err == 1 ? LtRed : Color(255, 175, 0)); - } - if(!b.IsEmpty()) sPaintImage(w, y, fy, b == "1" ? CodeEditorImg::Breakpoint() : b == "\xe" ? CodeEditorImg::InvalidBreakpoint() : @@ -276,11 +275,26 @@ WhenBreakpoint(ln); } -void EditorBar::SetEdited(int ln, int edit) +void EditorBar::SetEdited(int ln, int count) { - li.At(ln).edited = edit; + for (int i = 0; i < count; i++) + li.At(ln + i).edited = editage; + editage++; } +void EditorBar::ClearMarkers(int ln, int count) +{ + if (ln < 0) { + ln = 0; + count = li.GetCount(); + } + else + count = min(count, li.GetCount()); + for (int i = 0; i < count; i++) + li.At(ln + i).edited = 0; + Refresh(); +} + void EditorBar::SetError(int ln, int err) { li.At(ln).error = err; @@ -340,6 +354,7 @@ bingenabled = true; hilite_if_endif = true; line_numbers = false; + editage = 1; } EditorBar::~EditorBar() Index: ide/Build.cpp =================================================================== --- ide/Build.cpp (revision 58) +++ ide/Build.cpp (working copy) @@ -570,6 +570,8 @@ ProcessEvents(); ms = msecs(); } + if (!ok) + SetErrorEditor(); } if(ok || !stoponerrors) ok = BuildPackage(wspc, 0, build_order.GetCount(), build_order.GetCount() + 1, @@ -577,7 +579,8 @@ } EndBuilding(ok); ReQualifyBrowserBase(); - SetErrorEditor(); + if (!ok) + SetErrorEditor(); return ok; } Index: ide/ide.cpp =================================================================== --- ide/ide.cpp (revision 58) +++ ide/ide.cpp (working copy) @@ -332,7 +332,7 @@ return false; } -bool Ide::FindLineError(String ln, Host& host, String &file, int &lineno, int &error) { +bool Ide::FindLineError(String ln, Host& host, String& file, int& lineno, int& error) { Vector wspc_paths; VectorMap bm = GetMethodVars(method); bool is_java = (bm.Get("BUILDER", Null) == "JDK"); @@ -478,6 +478,9 @@ void Ide::ClearErrorEditor() { + if (!mark_lines) + return; + for(int i = 0; i < filedata.GetCount(); i++) { ClearErrorEditor(filedata.GetKey(i)); } @@ -485,6 +488,9 @@ void Ide::ClearErrorEditor(String file) { + if (!mark_lines) + return; + if(file == editfile) editor.ClearErrors(); else { @@ -499,6 +505,9 @@ void Ide::SetErrorEditor() { + if (!mark_lines) + return; + bool refresh = false; String file; int lineno; Index: ide/ide.h =================================================================== --- ide/ide.h (revision 58) +++ ide/ide.h (working copy) @@ -653,6 +653,7 @@ bool header_guards; bool filetabs; bool auto_enclose; + bool mark_lines; int insert_include; int bordercolumn; Color bordercolor; @@ -784,6 +785,9 @@ void FindString(bool back); void FindNextError(); void FindPrevError(); + void ClearMarkersSelected(); + void ClearMarkersFile(); + void ClearMarkersAll(); void EditSpecial(Bar& menu); void TranslateString(); Index: ide/ide.key =================================================================== --- ide/ide.key (revision 58) +++ ide/ide.key (working copy) @@ -82,3 +82,6 @@ KEY(SWAPS, "Go to definition/declaration", K_ALT_I) KEY(JUMPS, "Go to symbol definition", K_ALT_J) //KEY(INSERTCOLOR, "Insert choosen color value.."); +KEY(CLEARMARKERSSELECTED, "Remove change markers in selection", K_CTRL_R) +KEY(CLEARMARKERSFILE, "Remove change markers in file", K_ALT_R) +KEY(CLEARMARKERSALL, "Reomve all change markers", K_SHIFT|K_ALT_R) \ No newline at end of file Index: ide/ide.lay =================================================================== --- ide/ide.lay (revision 58) +++ ide/ide.lay (working copy) @@ -416,6 +416,7 @@ ITEM(Switch, insert_include, SetLabel(t_("No #include in new souces\n#include first\n#include previous")).LeftPosZ(316, 156).TopPosZ(32, 56)) ITEM(Option, header_guards, SetLabel(t_("Insert guards to new headers")).LeftPosZ(316, 164).TopPosZ(12, 15)) ITEM(Option, auto_enclose, SetLabel(t_("[ { ( \" / * enclose selection")).LeftPosZ(12, 168).TopPosZ(236, 15)) + ITEM(Option, mark_lines, SetLabel(t_("Mark lines with errors, warning and changes")).LeftPosZ(12, 256).TopPosZ(256, 15)) END_LAYOUT LAYOUT(SetupIdeLayout, 512, 248) @@ -485,3 +486,4 @@ ITEM(Button, ok, SetLabel(t_("OK")).LeftPosZ(264, 64).TopPosZ(32, 24)) ITEM(Button, cancel, SetLabel(t_("Cancel")).LeftPosZ(332, 64).TopPosZ(32, 24)) END_LAYOUT + Index: ide/idebar.cpp =================================================================== --- ide/idebar.cpp (revision 58) +++ ide/idebar.cpp (working copy) @@ -131,7 +131,6 @@ (menu.*add)("Paste", CtrlImg::paste(), THISBACK(EditPaste)) .Key(K_CTRL_V) .Help("Insert text from clipboard at cursor location"); - menu.MenuSeparator(); menu.Add(AK_SPACESTOTABS, THISBACK(EditMakeTabs)) @@ -172,6 +171,16 @@ .Help("Find any ordinary string constant (\"\" - delimited)"); menu.Add(AK_FINDSTRINGBACK, THISBACK1(FindString, true)) .Help("Find any ordinary string constant (\"\" - delimited) backwards"); + if (mark_lines && menu.IsMenuBar()) { + menu.Separator(); + menu.Add(AK_CLEARMARKERSSELECTED, THISBACK(ClearMarkersSelected)) + .Help("Remove change markers in current file"); + menu.Add(AK_CLEARMARKERSFILE, THISBACK(ClearMarkersFile)) + .Help("Remove change markers in current file"); + menu.Add(AK_CLEARMARKERSALL, THISBACK(ClearMarkersAll)) + .Help("Remove change markers in all files"); + menu.Separator(); + } if(menu.IsMenuBar()) menu.Add("Special", THISBACK(EditSpecial)); } Index: ide/idefile.cpp =================================================================== --- ide/idefile.cpp (revision 58) +++ ide/idefile.cpp (working copy) @@ -578,8 +578,10 @@ editor2.Highlight(editor.GetHighlight()); editor2.LoadHlStyles(editor.StoreHlStyles()); byte charset = editor.GetCharset(); + editor2.CheckEdited(false); editor2.Set(editor.Get(charset), charset); editor2.SetEditPosSb(editor.GetEditPos()); + editor2.CheckEdited(); IdeQuickTabs h; h.Set(tabs); tabs.Set(tabs2); @@ -662,3 +664,30 @@ editor2.topsbbutton1 <<= THISBACK(CloseSplit); } } + +void Ide::ClearMarkersSelected() +{ + int l, h; + if (editor.GetLineSelection(l, h)) + editor.ClearMarkers(l, h - l); + else + editor.ClearMarkers(editor.GetCursorLine()); +} + +void Ide::ClearMarkersFile() +{ + editor.ClearMarkers(); +} + +void Ide::ClearMarkersAll() +{ + ClearMarkersFile(); + for(int i = 0; i < filedata.GetCount(); i++) { + LineInfo li = editor.GetLineInfo(); + FileData& fd = Filedata(filedata.GetKey(i)); + editor.SetLineInfo(fd.lineinfo); + ClearMarkersFile(); + fd.lineinfo = editor.GetLineInfo(); + editor.SetLineInfo(li); + } +} \ No newline at end of file Index: ide/idewin.cpp =================================================================== --- ide/idewin.cpp (revision 58) +++ ide/idewin.cpp (working copy) @@ -504,7 +504,8 @@ filetabs = true; auto_enclose = false; - + mark_lines = true; + bordercolumn = 96; bordercolor = SColorFace(); Index: ide/Setup.cpp =================================================================== --- ide/Setup.cpp (revision 58) +++ ide/Setup.cpp (working copy) @@ -136,6 +136,7 @@ editor.HiliteIfEndif(hilite_if_endif); editor.LineNumbers(line_numbers); editor.AutoEnclose(auto_enclose); + editor.MarkLines(mark_lines); editor.BorderColumn(bordercolumn, bordercolor); editor.Refresh(); } @@ -213,6 +214,7 @@ (edt.header_guards, header_guards) (edt.insert_include, insert_include) (edt.auto_enclose, auto_enclose) + (edt.mark_lines, mark_lines) (edt.bordercolumn, bordercolumn) (edt.bordercolor, bordercolor) (ide.show_status_bar, show_status_bar)