Exceptions working with collapsed sections and using RectangleSelection #202
Labels
No labels
Area-Accessibility
Area-Build
Area-CodeCompletion
Area-Document
Area-Documentation
Area-Editing
Area-Folding
Area-Highlighting
Area-i18n
Area-Indentation
Area-NetFx
Area-Rendering
Area-Search
Area-Snippets
dependencies
duplicate
Feedback Needed
help wanted
invalid
Issue-Bug
Issue-Discussion
Issue-Enhancement
Issue-Performance
Issue-Question
on-hold
Resolution-Answered
Resolution-By Design
Resolution-Duplicate
Resolution-Fixed
Resolution-Won't Fix
Up-for-Grabs
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-icsharpcode/AvalonEdit#202
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi!
When using a RectangleSelection, using the Alt keyboard and mouse, while having collapsed sections, causes exception. I've put both exceptions in this issue, since they seem to be related.
First exception is: an InvalidOperationException with the message "Line 42 was skipped by a VisualLineElementGenerator, but it is not collapsed.",
Repro:
Second related exception ArgumentOutOfRangeException with: "0 <= offset <= 1550
Parameter name: offset
Actual value was 1987."
Repro:
I haven't found any quick fixes or workarounds for this.
Let me know if you have any clues or any tips to have that fixed.
Thanks
François
You can make this simpler by deleting a box that contains a collapsed region at the end of the file with no EOL or deleting a collapsed region that includes more than the EOL. Basically, you get called to generate a line at EOF (offset == document length) and the code asserts since you're at EOF.
N.B., there's an issue in that the Folding data for the lines isn't updated when the Selection is updated (which then uses the Folding generator to produce lines). This ordering dependency should be handled explicitly in TextArea::OnDocumentChanged rather than relying on notification ordering.