summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/screen-write.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2018-07-04 09:44:07 +0000
committernicm <nicm@openbsd.org>2018-07-04 09:44:07 +0000
commit7621e88f98edd17e57504f445f15691e4f7ef997 (patch)
treed4d8795ba09acd60def48e74ee90a4b88f39100e /usr.bin/tmux/screen-write.c
parentPrint the amount of bytes written, as intended, instead of -1 when (diff)
downloadwireguard-openbsd-7621e88f98edd17e57504f445f15691e4f7ef997.tar.xz
wireguard-openbsd-7621e88f98edd17e57504f445f15691e4f7ef997.zip
Add accessors for grid linedata member, for some future work. From Dan
Aloni.
Diffstat (limited to 'usr.bin/tmux/screen-write.c')
-rw-r--r--usr.bin/tmux/screen-write.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/tmux/screen-write.c b/usr.bin/tmux/screen-write.c
index 0aaa0b9a1f3..c2c5a3cb64a 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.136 2018/01/12 16:43:47 nicm Exp $ */
+/* $OpenBSD: screen-write.c,v 1.137 2018/07/04 09:44:07 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -408,7 +408,7 @@ screen_write_fast_copy(struct screen_write_ctx *ctx, struct screen *src,
break;
cx = s->cx;
for (xx = px; xx < px + nx; xx++) {
- if (xx >= gd->linedata[yy].cellsize)
+ if (xx >= grid_get_line(gd, yy)->cellsize)
break;
grid_get_cell(gd, xx, yy, &gc);
if (xx + gc.data.width > px + nx)
@@ -694,7 +694,7 @@ screen_write_backspace(struct screen_write_ctx *ctx)
if (s->cx == 0) {
if (s->cy == 0)
return;
- gl = &s->grid->linedata[s->grid->hsize + s->cy - 1];
+ gl = grid_get_line(s->grid, s->grid->hsize + s->cy - 1);
if (gl->flags & GRID_LINE_WRAPPED) {
s->cy--;
s->cx = screen_size_x(s) - 1;
@@ -917,7 +917,7 @@ screen_write_clearline(struct screen_write_ctx *ctx, u_int bg)
struct tty_ctx ttyctx;
u_int sx = screen_size_x(s);
- gl = &s->grid->linedata[s->grid->hsize + s->cy];
+ gl = grid_get_line(s->grid, s->grid->hsize + s->cy);
if (gl->cellsize == 0 && bg == 8)
return;
@@ -940,7 +940,7 @@ screen_write_clearendofline(struct screen_write_ctx *ctx, u_int bg)
struct tty_ctx ttyctx;
u_int sx = screen_size_x(s);
- gl = &s->grid->linedata[s->grid->hsize + s->cy];
+ gl = grid_get_line(s->grid, s->grid->hsize + s->cy);
if (s->cx > sx - 1 || (s->cx >= gl->cellsize && bg == 8))
return;
@@ -1043,7 +1043,7 @@ screen_write_linefeed(struct screen_write_ctx *ctx, int wrapped, u_int bg)
struct grid *gd = s->grid;
struct grid_line *gl;
- gl = &gd->linedata[gd->hsize + s->cy];
+ gl = grid_get_line(gd, gd->hsize + s->cy);
if (wrapped)
gl->flags |= GRID_LINE_WRAPPED;
else
@@ -1433,7 +1433,7 @@ screen_write_cell(struct screen_write_ctx *ctx, const struct grid_cell *gc)
screen_write_initctx(ctx, &ttyctx);
/* Handle overwriting of UTF-8 characters. */
- gl = &s->grid->linedata[s->grid->hsize + s->cy];
+ gl = grid_get_line(s->grid, s->grid->hsize + s->cy);
if (gl->flags & GRID_LINE_EXTENDED) {
grid_view_get_cell(gd, s->cx, s->cy, &now_gc);
if (screen_write_overwrite(ctx, &now_gc, width))