summaryrefslogtreecommitdiffstats
path: root/screen-write.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2010-04-06 21:35:44 +0000
committerNicholas Marriott <nicm@openbsd.org>2010-04-06 21:35:44 +0000
commitac9daf92d72210570dc9cb63fd0058e4ff50b7a5 (patch)
tree2700d98304c50772683402bc2a34b89afa6245f0 /screen-write.c
parentf81190a793d1b62ba12de54433c6a115db9950ca (diff)
Merge copy mode and output mode, dropping the latter. Idea and code from
Micah Cowan.
Diffstat (limited to 'screen-write.c')
-rw-r--r--screen-write.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/screen-write.c b/screen-write.c
index e26959fd..083544c4 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -1009,13 +1009,14 @@ screen_write_cell(struct screen_write_ctx *ctx,
}
/* Check this will fit on the current line and wrap if not. */
- if (s->cx > screen_size_x(s) - width) {
+ if ((s->mode & MODE_WRAP) && s->cx > screen_size_x(s) - width) {
screen_write_linefeed(ctx, 1);
s->cx = 0; /* carriage return */
}
/* Sanity checks. */
- if (s->cx > screen_size_x(s) - 1 || s->cy > screen_size_y(s) - 1)
+ if (((s->mode & MODE_WRAP) && s->cx > screen_size_x(s) - 1)
+ || s->cy > screen_size_y(s) - 1)
return;
/* Handle overwriting of UTF-8 characters. */