summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2017-02-08 15:49:29 +0000
committernicm <nicm@openbsd.org>2017-02-08 15:49:29 +0000
commit8bf48e2f2d1f6340d48b9567abb91038eef2ae0f (patch)
tree57be68a7bf65f9262e0b17248190e7615abbfe0f
parentAdd a helper to store a cell, and some tidying. (diff)
downloadwireguard-openbsd-8bf48e2f2d1f6340d48b9567abb91038eef2ae0f.tar.xz
wireguard-openbsd-8bf48e2f2d1f6340d48b9567abb91038eef2ae0f.zip
Some other tidying bits.
-rw-r--r--usr.bin/tmux/input.c3
-rw-r--r--usr.bin/tmux/screen-write.c25
-rw-r--r--usr.bin/tmux/server-client.c3
-rw-r--r--usr.bin/tmux/tty.c6
4 files changed, 16 insertions, 21 deletions
diff --git a/usr.bin/tmux/input.c b/usr.bin/tmux/input.c
index bd76888092b..2986cae7603 100644
--- a/usr.bin/tmux/input.c
+++ b/usr.bin/tmux/input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: input.c,v 1.112 2017/02/06 22:05:11 nicm Exp $ */
+/* $OpenBSD: input.c,v 1.113 2017/02/08 15:49:29 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -920,7 +920,6 @@ input_parse(struct window_pane *wp)
/* Split the parameter list (if any). */
static int
input_split(struct input_ctx *ictx)
-
{
const char *errstr;
char *ptr, *out;
diff --git a/usr.bin/tmux/screen-write.c b/usr.bin/tmux/screen-write.c
index 733d8a3c989..d38bdd5fdf1 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.107 2017/02/08 15:41:41 nicm Exp $ */
+/* $OpenBSD: screen-write.c,v 1.108 2017/02/08 15:49:29 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -51,9 +51,8 @@ void
screen_write_start(struct screen_write_ctx *ctx, struct window_pane *wp,
struct screen *s)
{
- u_int size;
- char tmp[16];
- const char *cp = tmp;
+ u_int size;
+ char tmp[16];
ctx->wp = wp;
if (wp != NULL && s == NULL)
@@ -71,12 +70,10 @@ screen_write_start(struct screen_write_ctx *ctx, struct window_pane *wp,
ctx->cells = ctx->written = ctx->skipped = 0;
- if (wp == NULL)
- cp = "no pane";
- else
+ if (wp != NULL)
snprintf(tmp, sizeof tmp, "pane %%%u", wp->id);
log_debug("%s: size %ux%u, %s", __func__, screen_size_x(ctx->s),
- screen_size_y(ctx->s), cp);
+ screen_size_y(ctx->s), wp == NULL ? "no pane" : tmp);
}
/* Finish writing. */
@@ -773,13 +770,13 @@ screen_write_clearline(struct screen_write_ctx *ctx, u_int bg)
struct tty_ctx ttyctx;
u_int sx = screen_size_x(s);
- screen_write_initctx(ctx, &ttyctx);
- ttyctx.bg = bg;
-
gl = &s->grid->linedata[s->grid->hsize + s->cy];
if (gl->cellsize == 0 && bg == 8)
return;
+ screen_write_initctx(ctx, &ttyctx);
+ ttyctx.bg = bg;
+
screen_dirty_clear(s, 0, s->cy, sx - 1, s->cy);
grid_view_clear(s->grid, 0, s->cy, sx, 1, bg);
@@ -795,13 +792,13 @@ screen_write_clearendofline(struct screen_write_ctx *ctx, u_int bg)
struct tty_ctx ttyctx;
u_int sx = screen_size_x(s);
- screen_write_initctx(ctx, &ttyctx);
- ttyctx.bg = bg;
-
gl = &s->grid->linedata[s->grid->hsize + s->cy];
if (s->cx > sx - 1 || (s->cx >= gl->cellsize && bg == 8))
return;
+ screen_write_initctx(ctx, &ttyctx);
+ ttyctx.bg = bg;
+
screen_dirty_clear(s, s->cx, s->cy, sx - 1, s->cy);
grid_view_clear(s->grid, s->cx, s->cy, sx - s->cx, 1, bg);
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c
index 9fcce74654f..d3412f30d35 100644
--- a/usr.bin/tmux/server-client.c
+++ b/usr.bin/tmux/server-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-client.c,v 1.210 2017/02/03 11:57:27 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.211 2017/02/08 15:49:29 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -963,6 +963,7 @@ server_client_loop(void)
}
}
+/* Resize timer event. */
static void
server_client_resize_event(__unused int fd, __unused short events, void *data)
{
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index 63b85e7a549..3570f8d719f 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.236 2017/02/08 15:24:48 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.237 2017/02/08 15:49:29 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1156,8 +1156,6 @@ tty_cmd_alignmenttest(struct tty *tty, const struct tty_ctx *ctx)
void
tty_cmd_cell(struct tty *tty, const struct tty_ctx *ctx)
{
- struct window_pane *wp = ctx->wp;
-
if (ctx->xoff + ctx->ocx > tty->sx - 1 && ctx->ocy == ctx->orlower) {
if (tty_pane_full_width(tty, ctx))
tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
@@ -1167,7 +1165,7 @@ tty_cmd_cell(struct tty *tty, const struct tty_ctx *ctx)
tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
- tty_cell(tty, ctx->cell, wp);
+ tty_cell(tty, ctx->cell, ctx->wp);
}
void