mirror of
https://github.com/tmux/tmux.git
synced 2026-10-16 16:44:30 +00:00
Merge remote-tracking branch 'refs/remotes/tmux-openbsd/master'
* refs/remotes/tmux-openbsd/master: Do not lose text after empty lists. Correct pane offsets when clipping both sides. Do not include ignore-size clients in status line sizing. Do not ignore lists with no alignment.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: format-draw.c,v 1.34 2026/07/21 07:20:18 nicm Exp $ */
|
/* $OpenBSD: format-draw.c,v 1.36 2026/10/15 22:34:26 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com>
|
* Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
@@ -223,6 +223,31 @@ format_draw_none(struct screen_write_ctx *octx, u_int available, u_int ocx,
|
|||||||
width_abs_centre);
|
width_abs_centre);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Append the text after a list to its alignment screen. */
|
||||||
|
static void
|
||||||
|
format_draw_merge(struct screen *s, u_int width, struct screen *after,
|
||||||
|
u_int width_after, struct format_ranges *frs)
|
||||||
|
{
|
||||||
|
struct screen_write_ctx ctx;
|
||||||
|
struct format_range *fr;
|
||||||
|
|
||||||
|
format_update_ranges(frs, s, 0, 0, width);
|
||||||
|
format_update_ranges(frs, after, width, 0, width_after);
|
||||||
|
|
||||||
|
if (frs != NULL) {
|
||||||
|
TAILQ_FOREACH(fr, frs, entry) {
|
||||||
|
if (fr->s == after)
|
||||||
|
fr->s = s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
screen_write_start(&ctx, s);
|
||||||
|
screen_write_cursormove(&ctx, width, 0, 0);
|
||||||
|
screen_write_fast_copy(&ctx, after, 0, 0, width_after, 1);
|
||||||
|
screen_write_cursormove(&ctx, width + width_after, 0, 0);
|
||||||
|
screen_write_stop(&ctx);
|
||||||
|
}
|
||||||
|
|
||||||
/* Draw format with list on the left. */
|
/* Draw format with list on the left. */
|
||||||
static void
|
static void
|
||||||
format_draw_left(struct screen_write_ctx *octx, u_int available, u_int ocx,
|
format_draw_left(struct screen_write_ctx *octx, u_int available, u_int ocx,
|
||||||
@@ -233,7 +258,6 @@ format_draw_left(struct screen_write_ctx *octx, u_int available, u_int ocx,
|
|||||||
{
|
{
|
||||||
u_int width_left, width_centre, width_right;
|
u_int width_left, width_centre, width_right;
|
||||||
u_int width_list, width_after, width_abs_centre;
|
u_int width_list, width_after, width_abs_centre;
|
||||||
struct screen_write_ctx ctx;
|
|
||||||
|
|
||||||
width_left = left->cx;
|
width_left = left->cx;
|
||||||
width_centre = centre->cx;
|
width_centre = centre->cx;
|
||||||
@@ -265,9 +289,8 @@ format_draw_left(struct screen_write_ctx *octx, u_int available, u_int ocx,
|
|||||||
|
|
||||||
/* If there is no list left, pass off to the no list function. */
|
/* If there is no list left, pass off to the no list function. */
|
||||||
if (width_list == 0) {
|
if (width_list == 0) {
|
||||||
screen_write_start(&ctx, left);
|
format_update_ranges(frs, list, 0, 0, 0);
|
||||||
screen_write_fast_copy(&ctx, after, 0, 0, width_after, 1);
|
format_draw_merge(left, width_left, after, width_after, frs);
|
||||||
screen_write_stop(&ctx);
|
|
||||||
|
|
||||||
format_draw_none(octx, available, ocx, ocy, left, centre,
|
format_draw_none(octx, available, ocx, ocy, left, centre,
|
||||||
right, abs_centre, frs);
|
right, abs_centre, frs);
|
||||||
@@ -336,7 +359,6 @@ format_draw_centre(struct screen_write_ctx *octx, u_int available, u_int ocx,
|
|||||||
{
|
{
|
||||||
u_int width_left, width_centre, width_right, middle;
|
u_int width_left, width_centre, width_right, middle;
|
||||||
u_int width_list, width_after, width_abs_centre;
|
u_int width_list, width_after, width_abs_centre;
|
||||||
struct screen_write_ctx ctx;
|
|
||||||
|
|
||||||
width_left = left->cx;
|
width_left = left->cx;
|
||||||
width_centre = centre->cx;
|
width_centre = centre->cx;
|
||||||
@@ -368,9 +390,8 @@ format_draw_centre(struct screen_write_ctx *octx, u_int available, u_int ocx,
|
|||||||
|
|
||||||
/* If there is no list left, pass off to the no list function. */
|
/* If there is no list left, pass off to the no list function. */
|
||||||
if (width_list == 0) {
|
if (width_list == 0) {
|
||||||
screen_write_start(&ctx, centre);
|
format_update_ranges(frs, list, 0, 0, 0);
|
||||||
screen_write_fast_copy(&ctx, after, 0, 0, width_after, 1);
|
format_draw_merge(centre, width_centre, after, width_after, frs);
|
||||||
screen_write_stop(&ctx);
|
|
||||||
|
|
||||||
format_draw_none(octx, available, ocx, ocy, left, centre,
|
format_draw_none(octx, available, ocx, ocy, left, centre,
|
||||||
right, abs_centre, frs);
|
right, abs_centre, frs);
|
||||||
@@ -444,7 +465,6 @@ format_draw_right(struct screen_write_ctx *octx, u_int available, u_int ocx,
|
|||||||
{
|
{
|
||||||
u_int width_left, width_centre, width_right;
|
u_int width_left, width_centre, width_right;
|
||||||
u_int width_list, width_after, width_abs_centre;
|
u_int width_list, width_after, width_abs_centre;
|
||||||
struct screen_write_ctx ctx;
|
|
||||||
|
|
||||||
width_left = left->cx;
|
width_left = left->cx;
|
||||||
width_centre = centre->cx;
|
width_centre = centre->cx;
|
||||||
@@ -476,9 +496,8 @@ format_draw_right(struct screen_write_ctx *octx, u_int available, u_int ocx,
|
|||||||
|
|
||||||
/* If there is no list left, pass off to the no list function. */
|
/* If there is no list left, pass off to the no list function. */
|
||||||
if (width_list == 0) {
|
if (width_list == 0) {
|
||||||
screen_write_start(&ctx, right);
|
format_update_ranges(frs, list, 0, 0, 0);
|
||||||
screen_write_fast_copy(&ctx, after, 0, 0, width_after, 1);
|
format_draw_merge(right, width_right, after, width_after, frs);
|
||||||
screen_write_stop(&ctx);
|
|
||||||
|
|
||||||
format_draw_none(octx, available, ocx, ocy, left, centre,
|
format_draw_none(octx, available, ocx, ocy, left, centre,
|
||||||
right, abs_centre, frs);
|
right, abs_centre, frs);
|
||||||
@@ -1007,6 +1026,14 @@ format_draw(struct screen_write_ctx *octx, const struct grid_cell *base,
|
|||||||
*/
|
*/
|
||||||
switch (list_align) {
|
switch (list_align) {
|
||||||
case STYLE_ALIGN_DEFAULT:
|
case STYLE_ALIGN_DEFAULT:
|
||||||
|
if (s[LIST].cx != 0 || s[AFTER].cx != 0) {
|
||||||
|
/* A list with default alignment is part of the left. */
|
||||||
|
format_draw_left(octx, available, ocx, ocy, &s[LEFT],
|
||||||
|
&s[CENTRE], &s[RIGHT], &s[ABSOLUTE_CENTRE],
|
||||||
|
&s[LIST], &s[LIST_LEFT], &s[LIST_RIGHT], &s[AFTER],
|
||||||
|
focus_start, focus_end, &frs);
|
||||||
|
break;
|
||||||
|
}
|
||||||
/* No list. */
|
/* No list. */
|
||||||
format_draw_none(octx, available, ocx, ocy, &s[LEFT],
|
format_draw_none(octx, available, ocx, ocy, &s[LEFT],
|
||||||
&s[CENTRE], &s[RIGHT], &s[ABSOLUTE_CENTRE], &frs);
|
&s[CENTRE], &s[RIGHT], &s[ABSOLUTE_CENTRE], &frs);
|
||||||
|
|||||||
4
resize.c
4
resize.c
@@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: resize.c,v 1.60 2026/10/12 13:08:19 nicm Exp $ */
|
/* $OpenBSD: resize.c,v 1.61 2026/10/15 22:28:41 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
@@ -472,7 +472,7 @@ recalculate_sizes_now(int now)
|
|||||||
s = c->session;
|
s = c->session;
|
||||||
if (s != NULL && !(c->flags & CLIENT_UNATTACHEDFLAGS))
|
if (s != NULL && !(c->flags & CLIENT_UNATTACHEDFLAGS))
|
||||||
s->attached++;
|
s->attached++;
|
||||||
if (ignore_client_size(c))
|
if (s == NULL)
|
||||||
continue;
|
continue;
|
||||||
if (c->tty.sy <= s->statuslines || (c->flags & CLIENT_CONTROL))
|
if (c->tty.sy <= s->statuslines || (c->flags & CLIENT_CONTROL))
|
||||||
c->flags |= CLIENT_STATUSOFF;
|
c->flags |= CLIENT_STATUSOFF;
|
||||||
|
|||||||
6
tty.c
6
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 <nicholas.marriott@gmail.com>
|
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
@@ -1189,7 +1189,7 @@ tty_clamp_line(struct tty *tty, const struct tty_ctx *ctx, u_int px, u_int py,
|
|||||||
*rx = nx;
|
*rx = nx;
|
||||||
} else if (xoff < (int)ctx->wox && xoff + nx > ctx->wox + ctx->wsx) {
|
} else if (xoff < (int)ctx->wox && xoff + nx > ctx->wox + ctx->wsx) {
|
||||||
/* Both left and right not visible. */
|
/* Both left and right not visible. */
|
||||||
*i = ctx->wox;
|
*i = ctx->wox - xoff;
|
||||||
*x = 0;
|
*x = 0;
|
||||||
*rx = ctx->wsx;
|
*rx = ctx->wsx;
|
||||||
} else if (xoff < (int)ctx->wox) {
|
} else if (xoff < (int)ctx->wox) {
|
||||||
@@ -1283,7 +1283,7 @@ tty_clamp_area(struct tty *tty, const struct tty_ctx *ctx, u_int px, u_int py,
|
|||||||
*rx = nx;
|
*rx = nx;
|
||||||
} else if (xoff < ctx->wox && xoff + nx > ctx->wox + ctx->wsx) {
|
} else if (xoff < ctx->wox && xoff + nx > ctx->wox + ctx->wsx) {
|
||||||
/* Both left and right not visible. */
|
/* Both left and right not visible. */
|
||||||
*i = ctx->wox;
|
*i = ctx->wox - xoff;
|
||||||
*x = 0;
|
*x = 0;
|
||||||
*rx = ctx->wsx;
|
*rx = ctx->wsx;
|
||||||
} else if (xoff < ctx->wox) {
|
} else if (xoff < ctx->wox) {
|
||||||
|
|||||||
Reference in New Issue
Block a user