summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/screen-write.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2022-10-25 17:53:32 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2022-10-25 17:53:32 +0000
commite21db289cf38e7ab420822d8fa2bf93ce821b913 (patch)
tree5cf3490aac8c7642bb7c1e417ddc625e802eb1a4 /usr.bin/tmux/screen-write.c
parent3fb1010bc307153ad61f2a8872f514c540121292 (diff)
Initialize context before testing it.
Diffstat (limited to 'usr.bin/tmux/screen-write.c')
-rw-r--r--usr.bin/tmux/screen-write.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/usr.bin/tmux/screen-write.c b/usr.bin/tmux/screen-write.c
index 3880577806a..3e8eeafd16e 100644
--- a/usr.bin/tmux/screen-write.c
+++ b/usr.bin/tmux/screen-write.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen-write.c,v 1.210 2022/10/25 09:04:49 nicm Exp $ */
+/* $OpenBSD: screen-write.c,v 1.211 2022/10/25 17:53:31 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1505,10 +1505,9 @@ screen_write_fullredraw(struct screen_write_ctx *ctx)
screen_write_collect_flush(ctx, 0, __func__);
- if (ttyctx.redraw_cb != NULL) {
- screen_write_initctx(ctx, &ttyctx, 1);
+ screen_write_initctx(ctx, &ttyctx, 1);
+ if (ttyctx.redraw_cb != NULL)
ttyctx.redraw_cb(&ttyctx);
- }
}
/* Trim collected items. */
@@ -2129,10 +2128,9 @@ screen_write_alternateon(struct screen_write_ctx *ctx, struct grid_cell *gc,
screen_write_collect_flush(ctx, 0, __func__);
screen_alternate_on(ctx->s, gc, cursor);
- if (ttyctx.redraw_cb != NULL) {
- screen_write_initctx(ctx, &ttyctx, 1);
+ screen_write_initctx(ctx, &ttyctx, 1);
+ if (ttyctx.redraw_cb != NULL)
ttyctx.redraw_cb(&ttyctx);
- }
}
/* Turn alternate screen off. */
@@ -2149,8 +2147,7 @@ screen_write_alternateoff(struct screen_write_ctx *ctx, struct grid_cell *gc,
screen_write_collect_flush(ctx, 0, __func__);
screen_alternate_off(ctx->s, gc, cursor);
- if (ttyctx.redraw_cb != NULL) {
- screen_write_initctx(ctx, &ttyctx, 1);
+ screen_write_initctx(ctx, &ttyctx, 1);
+ if (ttyctx.redraw_cb != NULL)
ttyctx.redraw_cb(&ttyctx);
- }
}