From 6f32a6ef1af7648936571aa9877eaa5bb6060db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sat, 2 Sep 2017 01:04:30 +0200 Subject: [PATCH] fix messed up insert/delete with region --- user/screen.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/user/screen.c b/user/screen.c index 53ca4e4..5b39d26 100644 --- a/user/screen.c +++ b/user/screen.c @@ -516,7 +516,7 @@ void screen_delete_lines(unsigned int lines) NOTIFY_LOCK(); // shift lines up - int targetEnd = H - 1 - lines; + int targetEnd = R1 - lines - 1; if (targetEnd <= cursor.y) { targetEnd = cursor.y; } else { @@ -635,7 +635,7 @@ screen_scroll_up(unsigned int lines) { NOTIFY_LOCK(); if (lines >= RH) { - clear_range(R0*W, (R1+1)*H-1); + clear_range(R0*W, (R1+1)*W-1); goto done; } @@ -663,7 +663,7 @@ screen_scroll_down(unsigned int lines) { NOTIFY_LOCK(); if (lines >= RH) { - clear_range(R0*W, (R1+1)*H-1); + clear_range(R0*W, (R1+1)*W-1); goto done; }