aboutsummaryrefslogtreecommitdiff
path: root/selection.c
diff options
context:
space:
mode:
Diffstat (limited to 'selection.c')
-rw-r--r--selection.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/selection.c b/selection.c
index 0ed25cd7..5d2cd61d 100644
--- a/selection.c
+++ b/selection.c
@@ -1108,16 +1108,8 @@ selection_finalize(struct seat *seat, struct terminal *term, uint32_t serial)
xassert(term->selection.start.row != -1);
xassert(term->selection.end.row != -1);
- if (term->selection.start.row > term->selection.end.row ||
- (term->selection.start.row == term->selection.end.row &&
- term->selection.start.col > term->selection.end.col))
- {
- struct coord tmp = term->selection.start;
- term->selection.start = term->selection.end;
- term->selection.end = tmp;
- }
-
- xassert(term->selection.start.row <= term->selection.end.row);
+ term->selection.start.row &= (term->grid->num_rows - 1);
+ term->selection.end.row &= (term->grid->num_rows - 1);
switch (term->conf->selection_target) {
case SELECTION_TARGET_NONE: