term: Fix bug related to scrolling regions

This commit is contained in:
mintsuki 2021-09-28 06:17:42 +02:00
parent bca6f924ba
commit 34cfd0e55b

View File

@ -691,7 +691,7 @@ static void control_sequence_parse(uint8_t c) {
break;
case 'r':
scroll_top_margin = 0;
scroll_bottom_margin = 0;
scroll_bottom_margin = term_rows;
if (esc_values_i > 0) {
scroll_top_margin = esc_values[0] - 1;
}
@ -699,7 +699,7 @@ static void control_sequence_parse(uint8_t c) {
scroll_bottom_margin = esc_values[1];
}
if (scroll_top_margin >= term_rows
|| scroll_bottom_margin >= term_rows
|| scroll_bottom_margin > term_rows
|| scroll_top_margin >= (scroll_bottom_margin - 1)) {
scroll_top_margin = 0;
scroll_bottom_margin = term_rows;