Only skip collecting text except for right margin when autowrap is off,

from Jang-Ho Hwang.
This commit is contained in:
nicm
2026-10-02 14:16:42 +00:00
committed by tmux update bot
parent a8523db838
commit dfcb588029

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: screen-write.c,v 1.296 2026/10/02 12:53:26 nicm Exp $ */
/* $OpenBSD: screen-write.c,v 1.297 2026/10/02 14:16:42 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -2664,6 +2664,10 @@ screen_write_collect_add(struct screen_write_ctx *ctx,
* Don't need to check that the attributes and whatnot are still the
* same - input_parse will end the collection when anything that isn't
* a plain character is encountered.
*
* Without wrapping, collect up to but not including the last column.
* Leave that cell to screen_write_cell so repeated writes overwrite it
* and the cursor remains at the right edge.
*/
collect = 1;
@@ -2673,7 +2677,8 @@ screen_write_collect_add(struct screen_write_ctx *ctx,
collect = 0;
else if (gc->attr & GRID_ATTR_CHARSET)
collect = 0;
else if (~s->mode & MODE_WRAP)
else if ((~s->mode & MODE_WRAP) &&
s->cx + ctx->item->used >= sx - 1)
collect = 0;
else if (s->mode & MODE_INSERT)
collect = 0;