mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-20 05:33:47 -04:00
selection: adjust start point when the selection changes direction
Without this, the initial cell will always be selected, regardless of how the selection is moved to the left or right. With this patch, the initial cell will only be selected while the selection is being made in the original direction. Changing direction of the selection moves the start point to next/previous character.
This commit is contained in:
parent
156cce6ef6
commit
8808dd28f2
3 changed files with 41 additions and 0 deletions
|
|
@ -181,6 +181,7 @@ enum mouse_reporting {
|
|||
enum cursor_style { CURSOR_BLOCK, CURSOR_UNDERLINE, CURSOR_BAR };
|
||||
|
||||
enum selection_kind { SELECTION_NONE, SELECTION_NORMAL, SELECTION_BLOCK };
|
||||
enum selection_direction {SELECTION_UNDIR, SELECTION_LEFT, SELECTION_RIGHT};
|
||||
|
||||
struct ptmx_buffer {
|
||||
void *data;
|
||||
|
|
@ -306,6 +307,7 @@ struct terminal {
|
|||
|
||||
struct {
|
||||
enum selection_kind kind;
|
||||
enum selection_direction direction;
|
||||
struct coord start;
|
||||
struct coord end;
|
||||
} selection;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue