Only rely on the previous line wrapping when the cursor is actually on

it, GitHub issue 5625 from Ben Maurer.
This commit is contained in:
nicm
2026-09-22 06:49:47 +00:00
committed by tmux update bot
parent 4624bc2129
commit 19b7660778

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: tty-draw.c,v 1.16 2026/09/21 10:22:31 nicm Exp $ */ /* $OpenBSD: tty-draw.c,v 1.17 2026/09/22 06:49:47 nicm Exp $ */
/* /*
* Copyright (c) 2026 Nicholas Marriott <nicholas.marriott@gmail.com> * Copyright (c) 2026 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -218,7 +218,12 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int px, u_int py, u_int nx,
} }
/* Did the previous line wrap on to this one? */ /* Did the previous line wrap on to this one? */
if (py != 0 && atx == 0 && tty->cx >= tty->sx && nx == tty->sx) { if (py != 0 &&
atx == 0 &&
tty->cx >= tty->sx &&
tty->cy != UINT_MAX &&
tty->cy + 1 == aty &&
nx == tty->sx) {
gl = grid_get_line(gd, gd->hsize + py - 1); gl = grid_get_line(gd, gd->hsize + py - 1);
if (gl->flags & GRID_LINE_WRAPPED) if (gl->flags & GRID_LINE_WRAPPED)
wrapped = 1; wrapped = 1;