be

based editor
git clone git://git.kocotian.pl/be.git
Log | Files | Refs | README | LICENSE

commit eeeb6e7f30039756e84300f4e5f1a90c77a564e6
parent 2ba47dbf858bd9d9856169415c0ccb2b951ad052
Author: kocotian <kocotian@kocotian.pl>
Date:   Sun, 18 Apr 2021 13:01:33 +0200

Fixed content displaying

Diffstat:
Mbe.c | 14++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/be.c b/be.c @@ -192,12 +192,14 @@ appendContents(String *ab) { ssize_t y; char cp[19]; - for (y = MAX(0, (signed)CURBUF(editor).y - FOCUSPOINT); - y < MIN(CURBUF(editor).rows.len, terminal.r - 2); - ++y) { - abPrintf(ab, cp, 19, "\033[%4ld;0H\033[K", - (ssize_t)FOCUSPOINT + y - (signed)CURBUF(editor).y); - abAppend(ab, CURBUF(editor).rows.data[y].data, CURBUF(editor).rows.data[y].len); + for (y = 0; y < terminal.r - 1; ++y) { + if (y + CURBUF(editor).y - FOCUSPOINT < CURBUF(editor).rows.len) { + abPrintf(ab, cp, 19, "\033[%4ld;0H\033[K", + y); + abAppend(ab, + CURBUF(editor).rows.data[y + CURBUF(editor).y - FOCUSPOINT].data, + CURBUF(editor).rows.data[y + CURBUF(editor).y - FOCUSPOINT].len); + } } }