diff options
author | Vsevolod Kukol <sevoku@microsoft.com> | 2019-07-03 23:29:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-03 23:29:33 +0300 |
commit | 1ef7211af3d7cf68aa7799cc62e6029526254629 (patch) | |
tree | f68912ef60e5c267daff4b4b55ba57b83e6aa3e5 | |
parent | dc31a0df5fb7a741d77e09c24b686f8a834ee553 (diff) | |
parent | c7377c63638b9aabdd4bbd6382c8774295364e64 (diff) |
Merge pull request #8038 from mono/backport-pr-8036-to-release-8.2
[release-8.2] Fixes VSTS Bug 935201: System.ArgumentOutOfRangeException exception in
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Documents/DocumentManager.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Documents/DocumentManager.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Documents/DocumentManager.cs index ef1f5c361f..c01448bdb4 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Documents/DocumentManager.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Documents/DocumentManager.cs @@ -658,10 +658,11 @@ namespace MonoDevelop.Ide.Gui.Documents var offset = info.Offset; if (offset < 0) { var line = textView.TextSnapshot.GetLineFromLineNumber (info.Line - 1); - if (info.Column >= 1) - offset = line.Start + info.Column - 1; - else + if (info.Column >= 1) { + offset = line.Start + Math.Min (info.Column - 1, line.Length); + } else { offset = line.Start; + } } if (editorOperationsFactoryService != null) { var editorOperations = editorOperationsFactoryService.GetEditorOperations (textView); |