mirror of
https://github.com/tmux/tmux.git
synced 2026-10-07 02:04:22 +00:00
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:
22
grid.c
22
grid.c
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user