Merge copy mode and output mode, dropping the latter. Idea and code from

Micah Cowan.
This commit is contained in:
Nicholas Marriott
2010-04-06 21:35:44 +00:00
parent f81190a793
commit ac9daf92d7
12 changed files with 222 additions and 401 deletions

View File

@ -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. */