aboutsummaryrefslogtreecommitdiff
path: root/screen-write.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2013-01-17 01:38:21 +0000
committerThomas Adam <thomas@xteddy.org>2013-01-17 01:38:21 +0000
commitde194016ec345db2a2a3e0b0d69080e288623597 (patch)
tree8222c9caa50815342d4ed66f2291c8b986926609 /screen-write.c
parent675c6b37734a622b4530d35505f897310fdb138c (diff)
parente33ba57c13139bc9ae6e92be169de6dc322e38eb (diff)
downloadrtmux-de194016ec345db2a2a3e0b0d69080e288623597.tar.gz
rtmux-de194016ec345db2a2a3e0b0d69080e288623597.tar.bz2
rtmux-de194016ec345db2a2a3e0b0d69080e288623597.zip
Merge branch 'obsd-master'
Diffstat (limited to 'screen-write.c')
-rw-r--r--screen-write.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/screen-write.c b/screen-write.c
index 02051119..9ab60f28 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -649,6 +649,30 @@ screen_write_deletecharacter(struct screen_write_ctx *ctx, u_int nx)
tty_write(tty_cmd_deletecharacter, &ttyctx);
}
+/* Clear nx characters. */
+void
+screen_write_clearcharacter(struct screen_write_ctx *ctx, u_int nx)
+{
+ struct screen *s = ctx->s;
+ struct tty_ctx ttyctx;
+
+ if (nx == 0)
+ nx = 1;
+
+ if (nx > screen_size_x(s) - s->cx)
+ nx = screen_size_x(s) - s->cx;
+ if (nx == 0)
+ return;
+
+ screen_write_initctx(ctx, &ttyctx, 0);
+
+ if (s->cx <= screen_size_x(s) - 1)
+ grid_view_clear(s->grid, s->cx, s->cy, nx, 1);
+
+ ttyctx.num = nx;
+ tty_write(tty_cmd_clearcharacter, &ttyctx);
+}
+
/* Insert ny lines. */
void
screen_write_insertline(struct screen_write_ctx *ctx, u_int ny)