summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--term.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/term.c b/term.c
index 52e9257..c71d4dc 100644
--- a/term.c
+++ b/term.c
@@ -202,8 +202,13 @@ ACTION(nl) {
 		Y = MIN(Y + 1, B);
 	}
 }
-ACTION(ind) { scrollUp(t, 1); }
-ACTION(ri)  { scrollDown(t, 1); }
+ACTION(ri) {
+	if (Y == t->scroll.top) {
+		scrollDown(t, 1);
+	} else {
+		if (Y) Y--;
+	}
+}
 ACTION(su)  { scrollUp(t, MIN(P(0, 1), t->scroll.bot - t->scroll.top)); }
 ACTION(sd)  { scrollDown(t, MIN(P(0, 1), t->scroll.bot - t->scroll.top)); }
 ACTION(decstbm) {
@@ -364,7 +369,6 @@ static Action *Actions[][128] = {
 	[ESC]['8'] = decrc,
 	[ESC]['='] = nop,
 	[ESC]['>'] = nop,
-	[ESC]['D'] = ind,
 	[ESC]['M'] = ri,
 	[ESC]['['] = csi,
 	[ESC][']'] = osc,