Skip to content

Commit 0a20ce5

Browse files
authored
Merge pull request mono#7323 from mono/Fixes-792482
[SourceEditor] Takes line length as column when cursor is set at the …
2 parents 9f142ff + 003f835 commit 0a20ce5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,8 +1487,9 @@ void OnIconButtonPress (object s, MarginMouseEventArgs args)
14871487
} else if (args.Button == 1) {
14881488
if (!string.IsNullOrEmpty (Document.FileName)) {
14891489
if (args.LineSegment != null) {
1490-
int column = TextEditor.Caret.Line == args.LineNumber ? TextEditor.Caret.Column : 1;
1491-
1490+
int column = TextEditor.Caret.Line == args.LineNumber ?
1491+
Math.Min (TextEditor.Caret.Column, args.LineSegment.Length) : 1;
1492+
14921493
lock (breakpoints)
14931494
breakpoints.Toggle (Document.FileName, args.LineNumber, column);
14941495
}

0 commit comments

Comments
 (0)