mirror of
https://github.com/tmux/tmux.git
synced 2024-12-13 01:48:47 +00:00
Add screen write flags instead of individual bits and fix line length
calculation with padding.
This commit is contained in:
parent
0bdbf47ef9
commit
09a66451ce
4
grid.c
4
grid.c
@ -1391,7 +1391,9 @@ grid_line_length(struct grid *gd, u_int py)
|
|||||||
px = gd->sx;
|
px = gd->sx;
|
||||||
while (px > 0) {
|
while (px > 0) {
|
||||||
grid_get_cell(gd, px - 1, py, &gc);
|
grid_get_cell(gd, px - 1, py, &gc);
|
||||||
if (gc.data.size != 1 || *gc.data.data != ' ')
|
if ((gc.flags & GRID_FLAG_PADDING) ||
|
||||||
|
gc.data.size != 1 ||
|
||||||
|
*gc.data.data != ' ')
|
||||||
break;
|
break;
|
||||||
px--;
|
px--;
|
||||||
}
|
}
|
||||||
|
@ -184,10 +184,10 @@ screen_write_initctx(struct screen_write_ctx *ctx, struct tty_ctx *ttyctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->wp != NULL &&
|
if (ctx->wp != NULL &&
|
||||||
!ctx->sync &&
|
(~ctx->flags & SCREEN_WRITE_SYNC) &&
|
||||||
(sync || ctx->wp != ctx->wp->window->active)) {
|
(sync || ctx->wp != ctx->wp->window->active)) {
|
||||||
tty_write(tty_cmd_syncstart, ttyctx);
|
tty_write(tty_cmd_syncstart, ttyctx);
|
||||||
ctx->sync = 1;
|
ctx->flags |= SCREEN_WRITE_SYNC;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
tmux.h
4
tmux.h
@ -798,7 +798,9 @@ typedef void (*screen_write_init_ctx_cb)(struct screen_write_ctx *,
|
|||||||
struct screen_write_ctx {
|
struct screen_write_ctx {
|
||||||
struct window_pane *wp;
|
struct window_pane *wp;
|
||||||
struct screen *s;
|
struct screen *s;
|
||||||
int sync;
|
|
||||||
|
int flags;
|
||||||
|
#define SCREEN_WRITE_SYNC 0x1
|
||||||
|
|
||||||
screen_write_init_ctx_cb init_ctx_cb;
|
screen_write_init_ctx_cb init_ctx_cb;
|
||||||
void *arg;
|
void *arg;
|
||||||
|
Loading…
Reference in New Issue
Block a user