render: resize: no need to clear the selection - just truncate if necessary

This commit is contained in:
Daniel Eklöf 2020-04-17 21:11:30 +02:00
parent ef52ed8a10
commit 5509fe514a
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -1711,8 +1711,6 @@ maybe_resize(struct terminal *term, int width, int height, bool force)
if (!force && width == term->width && height == term->height && scale == term->scale)
return false;
selection_cancel(term);
/* Cancel an application initiated "Synchronized Update" */
term_disable_app_sync_updates(term);
@ -1814,6 +1812,12 @@ damage_view:
term->height / term->scale + title_height);
}
/* Make sure selection is within bounds */
term->selection.start.row = min(term->selection.start.row, term->rows - 1);
term->selection.start.col = min(term->selection.start.col, term->cols - 1);
term->selection.end.row = min(term->selection.end.row, term->rows - 1);
term->selection.end.col = min(term->selection.end.col, term->cols - 1);
tll_free(term->normal.scroll_damage);
tll_free(term->alt.scroll_damage);