aboutsummaryrefslogtreecommitdiff
path: root/commands.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-10-29 20:09:37 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-10-29 20:09:37 +0000
commita42df2434b796f19ff729e194dd6a22f5128b89a (patch)
treec95df42d6b884b22c8815661f2391ecdc53ffcef /commands.c
parentrender: regression: don't apply scroll damage when view is in scrollback (diff)
scrollback: regression: fix rendering of scrollback diffs less than a screen
When doing "small" scrolls (typically done via mouse wheel or similar), we render the scrolling by emitting a "scroll damage". A recent commit changed how scroll damage is rendered; only when the view is at the bottom ("following" the screen output) do we render the damage. To fix this, add a new type of scroll damage, SCROLL_DAMAGE_IN_VIEW and SCROLL_DAMAGE_REVERSE_IN_VIEW. These signal to the renderer that it should always render the damage.
Diffstat (limited to 'commands.c')
-rw-r--r--commands.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/commands.c b/commands.c
index 01e73981..5d20b94b 100644
--- a/commands.c
+++ b/commands.c
@@ -72,7 +72,7 @@ cmd_scrollback_up(struct terminal *term, int rows)
term->grid->view = new_view;
if (diff >= 0 && diff < term->rows) {
- term_damage_scroll(term, DAMAGE_SCROLL_REVERSE, (struct scroll_region){0, term->rows}, diff);
+ term_damage_scroll(term, DAMAGE_SCROLL_REVERSE_IN_VIEW, (struct scroll_region){0, term->rows}, diff);
term_damage_rows_in_view(term, 0, diff - 1);
} else
term_damage_view(term);
@@ -142,7 +142,7 @@ cmd_scrollback_down(struct terminal *term, int rows)
term->grid->view = new_view;
if (diff >= 0 && diff < term->rows) {
- term_damage_scroll(term, DAMAGE_SCROLL, (struct scroll_region){0, term->rows}, diff);
+ term_damage_scroll(term, DAMAGE_SCROLL_IN_VIEW, (struct scroll_region){0, term->rows}, diff);
term_damage_rows_in_view(term, term->rows - diff, term->rows - 1);
} else
term_damage_view(term);