You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am experiencing an occasional exception when updating TextDocument.Text attached to a TextEditor with Foldings.
Version: Avalonia.AvaloniaEdit 11.1.0
Repro Steps:
Create TextEditor with FoldingManager
Set TextDocument.Text
Update Foldings
Update TextDocument.Text
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.InvalidOperationException: Document is null
at AvaloniaEdit.Rendering.TextView.CollapseLines(DocumentLine start, DocumentLine end)
at AvaloniaEdit.Folding.FoldingSection.ValidateCollapsedLineSections()
at AvaloniaEdit.Folding.FoldingSection.OnSegmentChanged()
at AvaloniaEdit.Document.TextSegmentCollection`1.ReplaceText(OffsetChangeMapEntry change)
at AvaloniaEdit.Document.TextSegmentCollection`1.OnDocumentChanged(Object sender, DocumentChangeEventArgs e)
at AvaloniaEdit.Folding.FoldingManager.OnDocumentChanged(Object sender, DocumentChangeEventArgs e)
at InvokeStub_EventHandler`1.Invoke(Object, Span`1)
at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
--- End of inner exception stack trace ---
at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at AvaloniaEdit.Utils.WeakEventManagerBase`4.WeakHandlerList.DeliverEvent(Object sender, TEventArgs args)
at AvaloniaEdit.Utils.WeakEventManagerBase`4.PrivateDeliverEvent(Object sender, TEventArgs args)
at AvaloniaEdit.Document.TextDocument.DoReplace(Int32 offset, Int32 length, ITextSource newText, OffsetChangeMap offsetChangeMap)
at AvaloniaEdit.Document.TextDocument.Replace(Int32 offset, Int32 length, ITextSource text, OffsetChangeMap offsetChangeMap)
at AvaloniaEdit.Document.TextDocument.set_Text(String value)
...
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.InvalidOperationException: Document is null
at AvaloniaEdit.Rendering.TextView.CollapseLines(DocumentLine start, DocumentLine end)
at AvaloniaEdit.Folding.FoldingSection.ValidateCollapsedLineSections()
at AvaloniaEdit.Folding.FoldingSection.OnSegmentChanged()
at AvaloniaEdit.Document.TextSegmentCollection`1.ReplaceText(OffsetChangeMapEntry change)
at AvaloniaEdit.Document.TextSegmentCollection`1.UpdateOffsetsInternal(OffsetChangeMapEntry change)
at AvaloniaEdit.Document.TextSegmentCollection`1.OnDocumentChanged(Object sender, DocumentChangeEventArgs e)
at AvaloniaEdit.Document.TextSegmentCollection`1.UpdateOffsets(DocumentChangeEventArgs e)
at AvaloniaEdit.Folding.FoldingManager.OnDocumentChanged(Object sender, DocumentChangeEventArgs e)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
--- End of inner exception stack trace ---
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at AvaloniaEdit.Utils.WeakEventManagerBase`4.WeakHandlerList.DeliverEvent(Object sender, TEventArgs args)
at AvaloniaEdit.Utils.WeakEventManagerBase`4.PrivateDeliverEvent(Object sender, TEventArgs args)
at AvaloniaEdit.Utils.WeakEventManagerBase`4.DeliverEvent(Object sender, TEventArgs args)
at AvaloniaEdit.Document.TextDocument.DoReplace(Int32 offset, Int32 length, ITextSource newText, OffsetChangeMap offsetChangeMap)
at AvaloniaEdit.Document.TextDocument.Replace(Int32 offset, Int32 length, ITextSource text, OffsetChangeMap offsetChangeMap)
at AvaloniaEdit.Document.TextDocument.Replace(Int32 offset, Int32 length, String text)
at AvaloniaEdit.Document.TextDocument.set_Text(String value)
...
The text was updated successfully, but these errors were encountered:
I am experiencing an occasional exception when updating TextDocument.Text attached to a TextEditor with Foldings.
Version: Avalonia.AvaloniaEdit 11.1.0
Repro Steps:
The text was updated successfully, but these errors were encountered: