From a4e70e8c8dd2c5f367b5baa14d9bf2f39b6fb09d Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Sat, 10 Aug 2019 16:22:08 -0400 Subject: Fix RI It's like reverse-NL, not just scrolling. --- term.c | 10 +++++++--- 1 file 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, -- cgit 1.4.1 a> commit diff homepage
path: root/2023 (unfollow)
Commit message (Expand)Author
2023-12-19Solve day 11 part 2 HEAD masterJune McEnroe