Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/tsm/tsm-selection.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ void tsm_screen_selection_start(struct tsm_screen *con,
/* TODO: more sophisticated ageing */
con->age = con->age_cnt;

if (posx >= con->size_x)
posx = con->size_x - 1;
if (posy >= con->size_y)
posy = con->size_y - 1;

con->sel_active = true;
selection_set(con, &con->sel_start, posx, posy);
memcpy(&con->sel_end, &con->sel_start, sizeof(con->sel_end));
Expand All @@ -161,6 +166,11 @@ void tsm_screen_selection_target(struct tsm_screen *con,
/* TODO: more sophisticated ageing */
con->age = con->age_cnt;

if (posx >= con->size_x)
posx = con->size_x - 1;
if (posy >= con->size_y)
posy = con->size_y - 1;

selection_set(con, &con->sel_end, posx, posy);
}

Expand All @@ -176,6 +186,11 @@ void tsm_screen_selection_word(struct tsm_screen *con,
/* TODO: more sophisticated ageing */
con->age = con->age_cnt;

if (posx >= con->size_x)
posx = con->size_x - 1;
if (posy >= con->size_y)
posy = con->size_y - 1;

word_select(con, posx, posy);
}

Expand Down
Loading