diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2011-09-27 14:19:18 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2011-09-27 14:19:18 +0400 |
commit | 6a5822535e9fc65e33766f5cb2c45352198ec1a2 (patch) | |
tree | 557a94709988ccf823046a108d02a6f04f6ed77b /main/src/addins/MonoDevelop.SourceEditor2 | |
parent | 1e21911871bf400c75be7383168ee33ebe189042 (diff) |
Fixed 'Bug 1049 - Cannot place cursor at the end of a collapsed
method'.
Diffstat (limited to 'main/src/addins/MonoDevelop.SourceEditor2')
-rw-r--r-- | main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs index 3c864bab03..57fcac7ab4 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs @@ -348,12 +348,10 @@ namespace MonoDevelop.SourceEditor { Document document = textEditorData.Document; if (document == null || region.Start.Line <= 0 || region.End.Line <= 0 || region.Start.Line > document.LineCount || region.End.Line > document.LineCount) - { return null; - } - int startOffset = document.LocationToOffset (region.Start.Line, region.Start.Column); - int endOffset = document.LocationToOffset (region.End.Line, region.End.Column ); + // end doesn't include the char at that position. + int endOffset = document.LocationToOffset (region.End.Line, region.End.Column) - 1; FoldSegment result = new FoldSegment (document, text, startOffset, endOffset - startOffset, type); foldSegments.Add (result); |