Track window scrolling for damage.

This commit is contained in:
nicm
2026-10-14 12:48:50 +00:00
committed by Nicholas Marriott
parent d1a68c1347
commit e69cdbefef
3 changed files with 53 additions and 3 deletions

10
tty.c
View File

@@ -1,4 +1,4 @@
/* $OpenBSD: tty.c,v 1.488 2026/10/14 11:54:55 nicm Exp $ */
/* $OpenBSD: tty.c,v 1.489 2026/10/14 12:48:50 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1681,10 +1681,12 @@ tty_cmd_reverseindex(struct tty *tty, const struct tty_ctx *ctx)
!tty_term_has(tty->term, TTYC_RIN)) ||
ctx->sx == 1 ||
ctx->sy == 1) {
redraw_scroll_result(tty, ctx, 1);
tty_redraw_region(tty, ctx);
return;
}
redraw_scroll_result(tty, ctx, 0);
tty_default_attributes(tty, ctx->bg, &ctx->style_ctx);
tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
@@ -1709,10 +1711,12 @@ tty_cmd_linefeed(struct tty *tty, const struct tty_ctx *ctx)
!tty_term_has(tty->term, TTYC_CSR) ||
ctx->sx == 1 ||
ctx->sy == 1) {
redraw_scroll_result(tty, ctx, 1);
tty_redraw_region(tty, ctx);
return;
}
redraw_scroll_result(tty, ctx, 0);
tty_default_attributes(tty, ctx->bg, &ctx->style_ctx);
tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
@@ -1747,10 +1751,12 @@ tty_cmd_scrollup(struct tty *tty, const struct tty_ctx *ctx)
!tty_term_has(tty->term, TTYC_CSR) ||
ctx->sx == 1 ||
ctx->sy == 1) {
redraw_scroll_result(tty, ctx, 1);
tty_redraw_region(tty, ctx);
return;
}
redraw_scroll_result(tty, ctx, 0);
tty_default_attributes(tty, ctx->bg, &ctx->style_ctx);
tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
@@ -1785,10 +1791,12 @@ tty_cmd_scrolldown(struct tty *tty, const struct tty_ctx *ctx)
!tty_term_has(tty->term, TTYC_RIN)) ||
ctx->sx == 1 ||
ctx->sy == 1) {
redraw_scroll_result(tty, ctx, 1);
tty_redraw_region(tty, ctx);
return;
}
redraw_scroll_result(tty, ctx, 0);
tty_default_attributes(tty, ctx->bg, &ctx->style_ctx);
tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);