mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
term_remove_all_multi_cursors(): early return if no extra cursors are active
This commit is contained in:
parent
fba9bb6853
commit
1055d32e9f
2 changed files with 9 additions and 4 deletions
6
csi.c
6
csi.c
|
|
@ -988,15 +988,13 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
|||
/* Erase entire screen */
|
||||
term_erase(term, 0, 0, term->rows - 1, term->cols - 1);
|
||||
term->grid->cursor.lcf = false;
|
||||
if (unlikely(term->multi_cursor.shapes != NULL))
|
||||
term_remove_all_multi_cursors(term);
|
||||
term_remove_all_multi_cursors(term);
|
||||
break;
|
||||
|
||||
case 3: {
|
||||
/* Erase scrollback */
|
||||
term_erase_scrollback(term);
|
||||
if (unlikely(term->multi_cursor.shapes != NULL))
|
||||
term_remove_all_multi_cursors(term);
|
||||
term_remove_all_multi_cursors(term);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2117,6 +2117,13 @@ term_theme_apply(struct terminal *term, const struct color_theme *theme)
|
|||
void
|
||||
term_remove_all_multi_cursors(struct terminal *term)
|
||||
{
|
||||
if (term->multi_cursor.shapes == NULL) {
|
||||
#if defined(_DEBUG)
|
||||
xassert(pixman_region32_empty(&term->multi_cursor.active));
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
pixman_region32_fini(&term->multi_cursor.active);
|
||||
pixman_region32_init(&term->multi_cursor.active);
|
||||
free(term->multi_cursor.shapes);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue