Fixed off-by-one error in scrolling logic

This commit is contained in:
Bruce Hill 2020-04-25 21:44:02 -07:00
parent f7ec9ff7b5
commit 54ff6604da

4
btui.h
View File

@ -726,10 +726,10 @@ int btui_scroll(btui_t *bt, int firstline, int lastline, int scroll_amount)
{ {
if (scroll_amount > 0) { if (scroll_amount > 0) {
return fprintf(bt->out, "\033[%d;%dr\033[%dS\033[r", return fprintf(bt->out, "\033[%d;%dr\033[%dS\033[r",
firstline, lastline, scroll_amount); firstline+1, lastline+1, scroll_amount);
} else if (scroll_amount < 0) { } else if (scroll_amount < 0) {
return fprintf(bt->out, "\033[%d;%dr\033[%dT\033[r", return fprintf(bt->out, "\033[%d;%dr\033[%dT\033[r",
firstline, lastline, -scroll_amount); firstline+1, lastline+1, -scroll_amount);
} }
return 0; return 0;
} }