Browse Source

Fix #1064: Do not resolve mouse position after the EOL to reference segment at the EOL.

pull/1066/merge
Siegfried Pammer 8 years ago
parent
commit
bc10e9c923
  1. 10
      ILSpy/TextView/DecompilerTextView.cs

10
ILSpy/TextView/DecompilerTextView.cs

@ -176,7 +176,7 @@ namespace ICSharpCode.ILSpy.TextView @@ -176,7 +176,7 @@ namespace ICSharpCode.ILSpy.TextView
void TextViewMouseHover(object sender, MouseEventArgs e)
{
TextViewPosition? position = textEditor.TextArea.TextView.GetPosition(e.GetPosition(textEditor.TextArea.TextView) + textEditor.TextArea.TextView.ScrollOffset);
TextViewPosition? position = GetPositionFromMousePosition();
if (position == null)
return;
int offset = textEditor.Document.GetOffset(position.Value.Location);
@ -757,7 +757,13 @@ namespace ICSharpCode.ILSpy.TextView @@ -757,7 +757,13 @@ namespace ICSharpCode.ILSpy.TextView
internal TextViewPosition? GetPositionFromMousePosition()
{
return textEditor.TextArea.TextView.GetPosition(Mouse.GetPosition(textEditor.TextArea.TextView) + textEditor.TextArea.TextView.ScrollOffset);
var position = textEditor.TextArea.TextView.GetPosition(Mouse.GetPosition(textEditor.TextArea.TextView) + textEditor.TextArea.TextView.ScrollOffset);
if (position == null)
return null;
var lineLength = textEditor.Document.GetLineByNumber(position.Value.Line).Length + 1;
if (position.Value.Column == lineLength)
return null;
return position;
}
public DecompilerTextViewState GetState()

Loading…
Cancel
Save