Skip to content

Commit

Permalink
* TextControl.cs: Special case for setting selection end to
Browse files Browse the repository at this point in the history
        selection start, we basically kill the anchor.
        - some todo comments.


svn path=/trunk/mcs/; revision=66560
  • Loading branch information
Jackson Harper committed Oct 11, 2006
1 parent 7120de6 commit 71bcb49
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
@@ -1,3 +1,9 @@
2006-10-11 Jackson Harper <jackson@ximian.com>

* TextControl.cs: Special case for setting selection end to
selection start, we basically kill the anchor.
- some todo comments.

2006-10-11 Chris Toshok <toshok@ximian.com>

* Control.cs: switch to using an "invalid_region" to track which
Expand Down
Expand Up @@ -2168,6 +2168,7 @@ internal struct Marker {
line.text.Insert(pos, s);
tag.length += len;

// TODO: sometimes getting a null tag here when pasting ???
tag = tag.next;
while (tag != null) {
tag.start += len;
Expand Down Expand Up @@ -3208,7 +3209,18 @@ internal struct Marker {
}

internal void SetSelectionEnd(Line end, int end_pos) {
if ((end.line_no < selection_anchor.line.line_no) || ((end == selection_anchor.line) && (end_pos <= selection_anchor.pos))) {

if (end == selection_end.line && end_pos == selection_start.pos) {
selection_anchor.line = selection_start.line;
selection_anchor.tag = selection_start.tag;
selection_anchor.pos = selection_start.pos;

selection_end.line = selection_start.line;
selection_end.tag = selection_start.tag;
selection_end.pos = selection_start.pos;

selection_end_anchor = false;
} else if ((end.line_no < selection_anchor.line.line_no) || ((end == selection_anchor.line) && (end_pos <= selection_anchor.pos))) {
selection_start.line = end;
selection_start.tag = LineTag.FindTag(end, end_pos);
selection_start.pos = end_pos;
Expand All @@ -3235,6 +3247,7 @@ internal struct Marker {
Invalidate(selection_start.line, selection_start.pos, selection_end.line, selection_end.pos);
} else {
selection_visible = false;
// ?? Do I need to invalidate here, tests seem to work without it, but I don't think they should :-s
}
}

Expand Down Expand Up @@ -3351,6 +3364,7 @@ internal struct Marker {
}
}


Insert(selection_start.line, null, selection_start.pos, true, s);

selection_end.line = selection_start.line;
Expand Down

0 comments on commit 71bcb49

Please sign in to comment.