From 3c7c5d703f88d03ccd40bc7abfa6d90314ecdf55 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 26 Nov 2011 16:58:34 +0100 Subject: [PATCH] fix SD-1873 - Unhandled WPF Exception when deleting text in text editor --- .../AvalonEdit.AddIn/Src/CaretReferencesRenderer.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CaretReferencesRenderer.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CaretReferencesRenderer.cs index f8b4a9b5f0..13c17a0ff4 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CaretReferencesRenderer.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CaretReferencesRenderer.cs @@ -67,6 +67,10 @@ namespace ICSharpCode.AvalonEdit.AddIn this.delayMoveTimer.Stop(); this.delayMoveTimer.Tick += TimerMoveTick; this.editorView.TextArea.Caret.PositionChanged += CaretPositionChanged; + // fixes SD-1873 - Unhandled WPF Exception when deleting text in text editor + // clear highlights to avoid exceptions when trying to draw highlights in + // locations that have been deleted already. + this.editorView.Document.Changed += delegate { lastResolveResult = null; ClearHighlight(); }; } public void ClearHighlight()