summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-08-13 16:24:33 +0000
committernicm <nicm@openbsd.org>2009-08-13 16:24:33 +0000
commit4fa35baf1522c586daa3fa71b471533707ee7e6b (patch)
tree6b82055a2565b86a5c8d45607a781a1c7cf3c877
parent- remove super-obvious comments from vnodeop_entries[] (diff)
downloadwireguard-openbsd-4fa35baf1522c586daa3fa71b471533707ee7e6b.tar.xz
wireguard-openbsd-4fa35baf1522c586daa3fa71b471533707ee7e6b.zip
It was originally intended that scroll mode would show content that was
currently off-screen due to resize, but somewhere along the way this got lost. Restore this behaviour to scroll mode by fixing screen_write_copy to read up to the saved line length rather than the current screen width. Copy mode remains unaltered for now.
-rw-r--r--usr.bin/tmux/screen-write.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.bin/tmux/screen-write.c b/usr.bin/tmux/screen-write.c
index 50023b06dc0..8164cf3578d 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.20 2009/08/08 15:57:49 nicm Exp $ */
+/* $OpenBSD: screen-write.c,v 1.21 2009/08/13 16:24:33 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -184,24 +184,24 @@ screen_write_copy(struct screen_write_ctx *ctx,
{
struct screen *s = ctx->s;
struct grid *gd = src->grid;
+ struct grid_line *gl;
const struct grid_cell *gc;
- struct grid_utf8 *gu;
u_char *udata;
u_int xx, yy, cx, cy;
cx = s->cx;
cy = s->cy;
for (yy = py; yy < py + ny; yy++) {
+ gl = &gd->linedata[yy];
for (xx = px; xx < px + nx; xx++) {
- if (xx >= gd->sx || yy >= gd->hsize + gd->sy)
- gc = &grid_default_cell;
- else
- gc = grid_peek_cell(gd, xx, yy);
+ udata = NULL;
- udata = NULL;
- if (gc->flags & GRID_FLAG_UTF8) {
- gu = grid_get_utf8(gd, xx, yy);
- udata = gu->data;
+ if (xx >= gl->cellsize || yy >= gd->hsize + gd->sy)
+ gc = &grid_default_cell;
+ else {
+ gc = &gl->celldata[xx];
+ if (gc->flags & GRID_FLAG_UTF8)
+ udata = gl->utf8data[xx].data;
}
screen_write_cell(ctx, gc, udata);