aboutsummaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2007-10-05 17:51:56 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2007-10-05 17:51:56 +0000
commit1e252b9e9a1535298d44f976a5cd42bf136fe575 (patch)
treeafcf7c2294156c5778531a2e1b581103950dfdb8 /input.c
parentd00851cee16d8805a788ad4179ee47a12655c097 (diff)
downloadrtmux-1e252b9e9a1535298d44f976a5cd42bf136fe575.tar.gz
rtmux-1e252b9e9a1535298d44f976a5cd42bf136fe575.tar.bz2
rtmux-1e252b9e9a1535298d44f976a5cd42bf136fe575.zip
Wrap lines properly.
Diffstat (limited to 'input.c')
-rw-r--r--input.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/input.c b/input.c
index 305a1746..6f0ee7b9 100644
--- a/input.c
+++ b/input.c
@@ -1,4 +1,4 @@
-/* $Id: input.c,v 1.20 2007-10-04 19:03:51 nicm Exp $ */
+/* $Id: input.c,v 1.21 2007-10-05 17:51:56 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -430,8 +430,18 @@ input_handle_character(u_char ch, struct input_ctx *ictx)
if (ictx->s->cx > ictx->s->sx - 1 || ictx->s->cy > ictx->s->sy - 1)
return;
+
screen_write_character(ictx->s, ch);
input_store8(ictx->b, ch);
+
+ if (ictx->s->cx == ictx->s->sx - 1) {
+ ictx->s->cx = 0;
+ screen_cursor_down_scroll(ictx->s);
+
+ input_store8(ictx->b, '\r');
+ input_store8(ictx->b, '\n');
+ } else
+ ictx->s->cx++;
}
void