textlinedisplaycache: short-circuit y_range invalidation

If we have a y==-1 then we are generally invalidating the whole textview.
For this case, we can just discard the entire GtkTextLineDisplay cache.

Fixes #2975
This commit is contained in:
Christian Hergert 2020-08-02 16:35:50 -07:00
parent 7fe7d5ab4f
commit 94d17a6809

View File

@ -663,6 +663,12 @@ gtk_text_line_display_cache_invalidate_y_range (GtkTextLineDisplayCache *cache,
STAT_INC (cache->inval_by_y_range);
if (y < 0)
{
gtk_text_line_display_cache_invalidate (cache);
return;
}
btree = _gtk_text_buffer_get_btree (layout->buffer);
iter = find_iter_at_at_y (cache, layout, y);