Fix some int/u_int bugs and added some logging.

This commit is contained in:
Michael Grant
2026-03-17 17:05:57 +00:00
parent 6c9e2f7e6c
commit c42a939e98
3 changed files with 23 additions and 8 deletions

View File

@@ -1991,9 +1991,14 @@ screen_write_pane_obscured(struct window_pane *base_wp)
((wp->xoff >= base_wp->xoff &&
wp->xoff <= base_wp->xoff + (int)base_wp->sx) ||
(wp->xoff + (int)wp->sx >= base_wp->xoff &&
wp->xoff + wp->sx <= base_wp->xoff + base_wp->sx)))
wp->xoff + wp->sx <= base_wp->xoff + base_wp->sx))) {
log_debug("%s: base %%%u obscured by %%%u "
"(xoff=%u sx=%u vs base xoff=%u sx=%u)", __func__,
base_wp->id, wp->id,
wp->xoff, wp->sx, base_wp->xoff, base_wp->sx);
return (1);
}
}
return (0);
}
@@ -2037,7 +2042,12 @@ screen_write_collect_flush(struct screen_write_ctx *ctx, int scroll_only,
ttyctx.num = ctx->scrolled;
ttyctx.bg = ctx->bg;
ttyctx.obscured = screen_write_pane_obscured(wp);
log_debug("%s: obscured=%d for pane %%%u", __func__,
ttyctx.obscured, wp != NULL ? wp->id : 0);
tty_write(tty_cmd_scrollup, &ttyctx);
if (wp != NULL)
log_debug("%s: after scrollup, PANE_REDRAW=%d for %%%u",
__func__, !!(wp->flags & PANE_REDRAW), wp->id);
if (wp != NULL)
ctx->wp->flags |= PANE_REDRAWSCROLLBAR;