diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-01-06 10:14:11 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-01-06 10:14:11 +0000 |
| commit | 21dbb44a3019e5267c506fec6b902eb95734ac22 (patch) | |
| tree | d5e91987f7e282270ccd0618e09cc7fd5374c67d | |
| parent | selection: extend: don’t copy to primary - it is done when RMB is released (diff) | |
selection: extend-block: update pivot point and selection direction
| -rw-r--r-- | selection.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/selection.c b/selection.c index 499aca02..e922db53 100644 --- a/selection.c +++ b/selection.c @@ -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); } |
