diff --git a/uppsrc/ide/Errors.cpp b/uppsrc/ide/Errors.cpp index b39e8e269..58ea3d7d2 100644 --- a/uppsrc/ide/Errors.cpp +++ b/uppsrc/ide/Errors.cpp @@ -592,6 +592,25 @@ void Ide::FFoundMenu(Bar& bar) bar.Add("Copy all", THISBACK1(CopyFound, true)); } +void Ide::CopyError(bool all) +{ + int c = error.GetCursor(); + if(!all && c < 0) + return; + String txt; + int h = all ? error.GetCount() : error.GetCursor() + 1; + for(int i = all ? 0 : c; i < h; i++) + txt << error.Get(i, 0) << " (" << error.Get(i, 1) << "): " + << error.Get(i, 2).To().ToString() << "\r\n"; + WriteClipboardText(txt); +} + +void Ide::ErrorMenu(Bar& bar) +{ + bar.Add(error.IsCursor(), "Copy", THISBACK1(CopyError, false)); + bar.Add("Copy all", THISBACK1(CopyError, true)); +} + void Ide::SelError() { if(removing_notes) diff --git a/uppsrc/ide/ide.h b/uppsrc/ide/ide.h index f5487598b..80e74a5e6 100644 --- a/uppsrc/ide/ide.h +++ b/uppsrc/ide/ide.h @@ -985,6 +985,8 @@ public: void ConsoleLine(const String& line, bool assist = false); void ConsoleRunEnd(); void SyncErrorsMessage(); + void CopyError(bool all); + void ErrorMenu(Bar& bar); void ShowError(); void ShowFound(); void CopyFound(bool all); diff --git a/uppsrc/ide/idewin.cpp b/uppsrc/ide/idewin.cpp index 9f54868e7..5b6da846f 100644 --- a/uppsrc/ide/idewin.cpp +++ b/uppsrc/ide/idewin.cpp @@ -419,6 +419,7 @@ Ide::Ide() SetupError(error, "Message"); error.AddIndex("NOTES"); error.ColumnWidths("207 41 834"); + error.WhenBar = THISBACK(ErrorMenu); SetupError(ffound, "Source"); ffound.ColumnWidths("207 41 834");