Merge remote-tracking branch 'refs/remotes/tmux-openbsd/master'

* refs/remotes/tmux-openbsd/master:
  Correctly skip padding at end of line, GitHub issue 5411.
This commit is contained in:
tmux update bot
2026-07-29 20:04:07 +00:00
4 changed files with 30 additions and 15 deletions

22
grid.c
View File

@@ -1,4 +1,4 @@
/* $OpenBSD: grid.c,v 1.154 2026/07/20 11:16:33 nicm Exp $ */
/* $OpenBSD: grid.c,v 1.155 2026/07/29 17:42:56 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1681,6 +1681,26 @@ grid_line_length(struct grid *gd, u_int py)
return (px);
}
/* Get last position on line, not including padding. */
u_int
grid_line_limit(struct grid *gd, u_int py)
{
struct grid_cell gc;
u_int px;
px = grid_line_length(gd, py);
if (px == 0)
return (0);
px--;
while (px > 0) {
grid_get_cell(gd, px, py, &gc);
if (~gc.flags & GRID_FLAG_PADDING)
break;
px--;
}
return (px);
}
/* Check if character is in set. */
int
grid_in_set(struct grid *gd, u_int px, u_int py, const char *set)