From c59379881c47b5b803fb14865cfe7d04a536e6f2 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 25 Apr 2014 00:39:10 -0400 Subject: lines shouldn't wrap until the next character is actually drawn --- src/screen.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/screen.c b/src/screen.c index 459f136..5014474 100644 --- a/src/screen.c +++ b/src/screen.c @@ -53,17 +53,19 @@ void runes_screen_show_string_ascii(RunesTerm *t, char *buf, size_t len) size_t i; for (i = 0; i < len; ++i) { - struct runes_cell *cell = &scr->rows[scr->cur.row].cells[scr->cur.col]; + struct runes_cell *cell; + + if (scr->cur.col >= scr->max.col) { + scr->cur.col = 0; + scr->cur.row++; + } + cell = &scr->rows[scr->cur.row].cells[scr->cur.col]; cell->contents[0] = buf[i]; cell->contents[1] = '\0'; cell->len = 1; scr->cur.col++; - if (scr->cur.col >= scr->max.col) { - scr->cur.col = 0; - scr->cur.row++; - } } } -- cgit v1.2.3-54-g00ecf