selection: extending a selection is now interactive

That is, a selection extension can be resized just like an ordinary
extension.
This commit is contained in:
Daniel Eklöf 2020-07-27 16:44:41 +02:00
parent 50bd51c4d4
commit 7127a0a6c3
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 12 additions and 10 deletions

View file

@ -372,8 +372,8 @@ selection_extend_normal(struct terminal *term, int col, int row, uint32_t serial
if (row < start->row || (row == start->row && col < start->col)) {
/* Extend selection to start *before* current start */
new_start = (struct coord){col, row};
new_end = *end;
new_start = *end;
new_end = (struct coord){col, row};
}
else if (row > end->row || (row == end->row && col > end->col)) {
@ -391,8 +391,8 @@ selection_extend_normal(struct terminal *term, int col, int row, uint32_t serial
abs(linear - (end->row * term->cols + end->col)))
{
/* Move start point */
new_start = (struct coord){col, row};
new_end = *end;
new_start = *end;
new_end = (struct coord){col, row};
}
else {
@ -440,13 +440,13 @@ selection_extend_block(struct terminal *term, int col, int row, uint32_t serial)
/* Move one of the top corners */
if (abs(col - top_left.col) < abs(col - top_right.col)) {
new_start = (struct coord){col, row};
new_end = bottom_right;
new_start = bottom_right;
new_end = (struct coord){col, row};
}
else {
new_start = (struct coord){col, row};
new_end = bottom_left;
new_start = bottom_left;
new_end = (struct coord){col, row};
}
}