selection: extend-block: update pivot point and selection direction

This commit is contained in:
Daniel Eklöf 2021-01-06 11:14:11 +01:00
parent 3a34eda8cc
commit 21dbb44a30
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -900,6 +900,8 @@ selection_extend_block(struct terminal *term, int col, int row, uint32_t serial)
struct coord new_start;
struct coord new_end;
enum selection_direction direction = SELECTION_UNDIR;
if (row <= top_left.row ||
abs(row - top_left.row) < abs(row - bottom_left.row))
{
@ -930,6 +932,10 @@ selection_extend_block(struct terminal *term, int col, int row, uint32_t serial)
}
}
direction = col > new_start.col ? SELECTION_RIGHT : SELECTION_LEFT;
set_pivot_point_for_block_and_char_wise(term, new_start, direction);
term->selection.direction = direction;
selection_modify(term, new_start, new_end);
}