summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-08-07 15:01:40 -0400
committerJune McEnroe <june@causal.agency>2019-08-07 15:01:40 -0400
commitce2ff83a30a635c092c0027af1c17378eb66f744 (patch)
tree087c5ac7d03e5f3301205c6702b95bb75aab1116
parentImplement ICH (diff)
downloadstream-ce2ff83a30a635c092c0027af1c17378eb66f744.tar.gz
stream-ce2ff83a30a635c092c0027af1c17378eb66f744.zip
Implement IL
-rw-r--r--term.c18
1 files 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));