render: regression: don't apply scroll damage when view is in scrollback

When user has scrolled back in the output history, new output should
not trigger scrolling.

This was true for normal cell rendering, which renders the cells *in
view*, not caring where the "front" of the output is.

However, we still applied scroll damage. I.e. we memmoved part of the
screen.

The fix is simple; only apply scroll damage when the view is at the
front of the output.
This commit is contained in:
Daniel Eklöf 2019-10-28 17:58:44 +01:00
parent 293adbb295
commit 89cec15920
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -528,22 +528,25 @@ grid_render(struct terminal *term)
* by the cursor, since only the final cell matters. */
all_clean = false;
}
}
tll_foreach(term->grid->scroll_damage, it) {
switch (it->item.type) {
case DAMAGE_SCROLL:
grid_render_scroll(term, buf, &it->item);
break;
case DAMAGE_SCROLL_REVERSE:
grid_render_scroll_reverse(term, buf, &it->item);
break;
}
tll_remove(term->grid->scroll_damage, it);
}
if (term->grid->view == term->grid->offset) {
tll_foreach(term->grid->scroll_damage, it) {
switch (it->item.type) {
case DAMAGE_SCROLL:
grid_render_scroll(term, buf, &it->item);
break;
case DAMAGE_SCROLL_REVERSE:
grid_render_scroll_reverse(term, buf, &it->item);
break;
}
tll_remove(term->grid->scroll_damage, it);
}
} else
tll_free(term->grid->scroll_damage);
if (term->render.workers.count > 0) {
term->render.workers.buf = buf;