Merge output (more) and copy modes into one single mode (called copy).

This commit is contained in:
Micah Cowan
2010-04-05 05:11:44 +00:00
parent 5879e2a32b
commit 2d74ce1d3a
10 changed files with 235 additions and 150 deletions

View File

@ -1,4 +1,4 @@
/* $Id: screen-write.c,v 1.88 2009-12-04 22:14:47 tcunha Exp $ */
/* $Id: screen-write.c,v 1.89 2010-04-05 05:11:43 micahcowan Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -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. */