From 7447c5f9ae9f2c21590b3b8c789dc98c812180f0 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 15 Oct 2026 22:29:15 +0000 Subject: [PATCH] Correct pane offsets when clipping both sides. --- tty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tty.c b/tty.c index feae568c4..a577cc4f6 100644 --- a/tty.c +++ b/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.489 2026/10/14 12:48:50 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.490 2026/10/15 22:29:15 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -1172,7 +1172,7 @@ tty_clamp_line(struct tty *tty, const struct tty_ctx *ctx, u_int px, u_int py, *rx = nx; } else if (xoff < (int)ctx->wox && xoff + nx > ctx->wox + ctx->wsx) { /* Both left and right not visible. */ - *i = ctx->wox; + *i = ctx->wox - xoff; *x = 0; *rx = ctx->wsx; } else if (xoff < (int)ctx->wox) { @@ -1266,7 +1266,7 @@ tty_clamp_area(struct tty *tty, const struct tty_ctx *ctx, u_int px, u_int py, *rx = nx; } else if (xoff < ctx->wox && xoff + nx > ctx->wox + ctx->wsx) { /* Both left and right not visible. */ - *i = ctx->wox; + *i = ctx->wox - xoff; *x = 0; *rx = ctx->wsx; } else if (xoff < ctx->wox) {