termptyops.c: fix scrolling wrt bottom margin

Thanks to @ncim for the report
This commit is contained in:
Boris Faure 2017-08-22 22:08:11 +02:00
parent 7c358c3592
commit 0478a36799
1 changed files with 11 additions and 2 deletions

View File

@ -134,8 +134,17 @@ termpty_text_scroll_test(Termpty *ty, Eina_Bool clear)
{
int e = ty->h;
if (ty->termstate.bottom_margin != 0) e = ty->termstate.bottom_margin;
if (ty->cursor_state.cy >= e)
if (ty->termstate.bottom_margin != 0)
{
e = ty->termstate.bottom_margin;
if (ty->cursor_state.cy == e)
{
termpty_text_scroll(ty, clear);
ty->cursor_state.cy = e - 1;
TERMPTY_RESTRICT_FIELD(ty->cursor_state.cy, 0, ty->h);
}
}
else if (ty->cursor_state.cy >= ty->h)
{
termpty_text_scroll(ty, clear);
ty->cursor_state.cy = e - 1;