From 83ea3449d181818dde01988e625eb83b61018c4e Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 28 Sep 2019 15:52:15 +0200 Subject: [PATCH] Fix #1722: Don't abort mouse selection unless the user clicked on a hyperlink --- ILSpy/TextView/DecompilerTextView.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ILSpy/TextView/DecompilerTextView.cs b/ILSpy/TextView/DecompilerTextView.cs index a370e4984..17a53d9dc 100644 --- a/ILSpy/TextView/DecompilerTextView.cs +++ b/ILSpy/TextView/DecompilerTextView.cs @@ -649,12 +649,13 @@ namespace ICSharpCode.ILSpy.TextView if (referenceSegment == null) { ClearLocalReferenceMarks(); } else if (referenceSegment.IsLocal || !referenceSegment.IsDefinition) { - JumpToReference(referenceSegment); textEditor.TextArea.ClearSelection(); + // cancel mouse selection to avoid AvalonEdit selecting between the new + // cursor position and the mouse position. + textEditor.TextArea.MouseSelectionMode = MouseSelectionMode.None; + + JumpToReference(referenceSegment); } - // cancel mouse selection to avoid AvalonEdit selecting between the new - // cursor position and the mouse position. - textEditor.TextArea.MouseSelectionMode = MouseSelectionMode.None; } }