This exception was caused by FoldingManager.UpdateFolding() re-using FoldingSections and adjusting their end offset.
If those FoldingSections were folded, the corresponding CollapsedLineSection was not updated for the new end position.
This inconsistency would cause visual glitches (such as fold markers not updating properly), and in some cases the InvalidOperationException during rendering.
FoldingSection now handles when its StartOffset or EndOffset is changed, and updates the CollapsedLineSection accordingly.
proposed algorithm:
Each line is checked for leading indentation whitespaces. If
a line has the same or more indentation than the first line,
it is reduced. If a line has is less indented than the first line
the indentation is removed completely.
See the following example:
line 1
line 2
line 3
line 4
is reduced to:
line 1
line 2
line 3
line 4
Add TextEditor.ShowLineNumbers property to show/hide the line numbers (they now are hidden by default).
Add TextEditor.Options.ShowEndOfLine property to allow easily enabling end-of-line markers.
Changed AbstractMargin so that it automatically detects the TextView it is attached to.
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4906 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61