From ce2ff83a30a635c092c0027af1c17378eb66f744 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Wed, 7 Aug 2019 15:01:40 -0400 Subject: Implement IL --- term.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/term.c b/term.c index 3da2623..8c16c82 100644 --- a/term.c +++ b/term.c @@ -249,6 +249,7 @@ enum CSI { CUP, ED = 'J', EL, + IL = 'L', DL = 'M', DCH = 'P', SU = 'S', @@ -325,6 +326,17 @@ static char updateCSI(wchar_t ch) { clear(a, b); } + break; case IL: { + uint i = MIN((n ? ps[0] : 1), rows - y); + move(cell(y + i, 0), cell(y, 0), cols * (rows - y - i)); + clear(cell(y, 0), cell(y + i - 1, cols - 1)); + } + break; case ICH: { + uint i = MIN((n ? ps[0] : 1), cols - x); + move(cell(y, x + i), cell(y, x), cols - x - i); + clear(cell(y, x), cell(y, x + i - 1)); + } + break; case DL: { uint i = MIN((n ? ps[0] : 1), rows - y); move(cell(y, 0), cell(y + i, 0), cols * (rows - y - i)); @@ -336,12 +348,6 @@ static char updateCSI(wchar_t ch) { clear(cell(y, cols - i), cell(y, cols - 1)); } - break; case ICH: { - uint i = MIN((n ? ps[0] : 1), cols - x); - move(cell(y, x + i), cell(y, x), cols - x - i); - clear(cell(y, x), cell(y, x + i - 1)); - } - break; case SU: scrollUp(MIN((n ? ps[0] : 1), scroll.bot - scroll.top)); break; case SD: scrollDown(MIN((n ? ps[0] : 1), scroll.bot - scroll.top)); -- cgit 1.4.1