term_remove_all_multi_cursors(): early return if no extra cursors are active

This commit is contained in:
Daniel Eklöf 2025-08-29 13:21:42 +02:00
parent fba9bb6853
commit 1055d32e9f
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 9 additions and 4 deletions

View file

@ -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);