diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/ILineTracker.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/ILineTracker.cs index 0b99f61e64..c1d7a0a3da 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/ILineTracker.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/ILineTracker.cs @@ -32,6 +32,9 @@ namespace ICSharpCode.AvalonEdit.Document /// /// Is called immediately before a document line changes length. + /// This method will be called whenever the line is changed, even when the length stays as it is. + /// The method might be called multiple times for a single line because + /// a replacement is internally handled as removal followed by insertion. /// void SetLineLength(DocumentLine line, int newTotalLength); diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/InlineObjectRun.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/InlineObjectRun.cs index 29ea4b73a6..9ab6419f32 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/InlineObjectRun.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/InlineObjectRun.cs @@ -43,6 +43,8 @@ namespace ICSharpCode.AvalonEdit.Rendering throw new ArgumentNullException("context"); // remove inline object if its already added, can happen e.g. when recreating textrun for word-wrapping + // TODO: certainly the text view should handle this internally? external code might want to use InlineObjectRun, + // but doesn't have access to textLayer.RemoveInlineObject context.TextView.textLayer.RemoveInlineObject(this.Element); return new InlineObjectRun(1, this.TextRunProperties, this.Element);