If you select all text and delete it with the delete key, the following appears:
SharpDevelop Version : 2.1.0.2017
.NET Version : 2.0.50727.42
OS Version : Microsoft Windows NT 5.1.2600 Service Pack 2
Current culture : English (Australia) (en-AU)
Current UI language : en-US
Working Set Memory : 60576kb
GC Heap Memory : 19415kb
Exception thrown:
System.InvalidOperationException: Failed to compare two elements in the array. ---> System.ArgumentOutOfRangeException: should be between 0 and 0
Parameter name: offset
Actual value was -1.
at ICSharpCode.TextEditor.Document.DefaultLineManager.GetLineNumberForOffset(Int32 offset)
at ICSharpCode.TextEditor.Document.DefaultDocument.GetLineNumberForOffset(Int32 offset)
at ICSharpCode.TextEditor.Document.FoldMarker.GetPointForOffset(IDocument document, Int32 offset, Int32& line, Int32& column)
at ICSharpCode.TextEditor.Document.FoldMarker.get_EndLine()
at ICSharpCode.TextEditor.Document.FoldingManager.EndComparer.Compare(FoldMarker x, FoldMarker y)
at System.Collections.Generic.ArraySortHelper`1.BinarySearch(T[] array, Int32 index, Int32 length, T value, IComparer`1 comparer)
--- End of inner exception stack trace ---
at System.Collections.Generic.ArraySortHelper`1.BinarySearch(T[] array, Int32 index, Int32 length, T value, IComparer`1 comparer)
at System.Array.BinarySearch[T](T[] array, Int32 index, Int32 length, T value, IComparer`1 comparer)
at System.Collections.Generic.List`1.BinarySearch(Int32 index, Int32 count, T item, IComparer`1 comparer)
at ICSharpCode.TextEditor.Document.FoldingManager.GetFoldingsByEndAfterColumn(Int32 lineNumber, Int32 column, Boolean forceFolded)
at ICSharpCode.TextEditor.FoldMargin.PaintFoldMarker(Graphics g, Int32 lineNumber, Rectangle drawingRectangle)
at ICSharpCode.TextEditor.FoldMargin.Paint(Graphics g, Rectangle rect)
at ICSharpCode.TextEditor.TextArea.OnPaint(PaintEventArgs e)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
the editor is then crossed out in red until you close and reopen it.
I figure that something is not being found and is returning a -1, but that is not checked so the -1 is used to address something when there is nothing so only 0 is valid, so to speak.