mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-01 07:15:32 -04:00
selection: extend-block: update pivot point and selection direction
This commit is contained in:
parent
3a34eda8cc
commit
21dbb44a30
1 changed files with 6 additions and 0 deletions
|
|
@ -900,6 +900,8 @@ selection_extend_block(struct terminal *term, int col, int row, uint32_t serial)
|
||||||
struct coord new_start;
|
struct coord new_start;
|
||||||
struct coord new_end;
|
struct coord new_end;
|
||||||
|
|
||||||
|
enum selection_direction direction = SELECTION_UNDIR;
|
||||||
|
|
||||||
if (row <= top_left.row ||
|
if (row <= top_left.row ||
|
||||||
abs(row - top_left.row) < abs(row - bottom_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);
|
selection_modify(term, new_start, new_end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue