TextMarkers/Segments and deletion #327
Replies: 2 comments
-
As far as I can remember the I won't comment on any of your suggestions in #331 because AvalonEdit/ICSharpCode.AvalonEdit/Document/TextSegmentCollection.cs Lines 55 to 56 in 47f61e9 Nonetheless, I hope this helps! |
Beta Was this translation helpful? Give feedback.
-
SharpDevelop's |
Beta Was this translation helpful? Give feedback.
-
I've been playing around with the TextMarker example from https://github.com/siegfriedpammer/AvalonEditSamples and have encountered a problem when the text underpinning a marker is removed from the editor.
Basically I can capture a
TextSegment
'sOnSegmentChanged
and use that to remove the segment if it has been reduced to zero length. This works fine if the text edit is performed from within the segment's bounds:If however the entire segment's contents are deleted (via a selection which encompasses the segment and more), a zero length marker will stay.:
The segment disappears from the appropriate
TextSegmentCollection
(markers
is empty in https://github.com/siegfriedpammer/AvalonEditSamples/blob/bd6858eed774743b92d971b179b3bd3bb32655e7/TextMarkerSample/SharpDevelop/TextMarkerService.cs#L95) only to reappear during a subsequent Redraw (markers
is no longer empty in https://github.com/siegfriedpammer/AvalonEditSamples/blob/bd6858eed774743b92d971b179b3bd3bb32655e7/TextMarkerSample/SharpDevelop/TextMarkerService.cs#L123).How do I catch the second case?
Beta Was this translation helpful? Give feedback.
All reactions