1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

term_clrsb(): call deselect() if the selection was affected.

Any terminal event that modifies the range of screen+scrollback
currently covered by the mouse selection should call deselect(), so
that users won't be misled into thinking that the new version of the
highlighted text would be pasted, and also so that using the
MBT_EXTEND action to modify the selection bounds won't start from
a selection you never had in the first place.

Clearing the scrollback is such an event, if the selection covered any
of the scrollback at all; so we should apply the same policy here as
everywhere else.
This commit is contained in:
Simon Tatham 2019-07-24 19:00:52 +01:00
parent a6a13311b4
commit 5e2ac205fd

View File

@ -1633,6 +1633,13 @@ void term_clrsb(Terminal *term)
for (i = 0; i < term->rows; i++)
check_line_size(term, scrlineptr(i));
/*
* That operation has invalidated the selection, if it overlapped
* the scrollback at all.
*/
if (term->selstate != NO_SELECTION && term->selstart.y < 0)
deselect(term);
/*
* There are now no lines of real scrollback which can be pulled
* back into the screen by a resize, and no lines of the alternate