compat: fix scrolling not clearing some text
Test case was provided by weechat.
This commit is contained in:
parent
1dccb22ffc
commit
604a9abd85
|
@ -490,13 +490,13 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
|
||||||
DBG("scroll up N lines");
|
DBG("scroll up N lines");
|
||||||
arg = _csi_arg_get(&b);
|
arg = _csi_arg_get(&b);
|
||||||
if (arg < 1) arg = 1;
|
if (arg < 1) arg = 1;
|
||||||
for (i = 0; i < arg; i++) _termpty_text_scroll(ty, EINA_FALSE);
|
for (i = 0; i < arg; i++) _termpty_text_scroll(ty, EINA_TRUE);
|
||||||
break;
|
break;
|
||||||
case 'T': // scroll down N lines
|
case 'T': // scroll down N lines
|
||||||
DBG("scroll down N lines");
|
DBG("scroll down N lines");
|
||||||
arg = _csi_arg_get(&b);
|
arg = _csi_arg_get(&b);
|
||||||
if (arg < 1) arg = 1;
|
if (arg < 1) arg = 1;
|
||||||
for (i = 0; i < arg; i++) _termpty_text_scroll_rev(ty, EINA_FALSE);
|
for (i = 0; i < arg; i++) _termpty_text_scroll_rev(ty, EINA_TRUE);
|
||||||
break;
|
break;
|
||||||
case 'M': // delete N lines - cy
|
case 'M': // delete N lines - cy
|
||||||
case 'L': // insert N lines - cy
|
case 'L': // insert N lines - cy
|
||||||
|
|
|
@ -82,13 +82,11 @@ _termpty_text_scroll(Termpty *ty, Eina_Bool clear)
|
||||||
}
|
}
|
||||||
DBG("... scroll!!!!! [%i->%i]", start_y, end_y);
|
DBG("... scroll!!!!! [%i->%i]", start_y, end_y);
|
||||||
|
|
||||||
if (!clear)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (start_y == 0 && end_y == ty->h - 1)
|
if (start_y == 0 && end_y == ty->h - 1)
|
||||||
{
|
{
|
||||||
// screen is a circular buffer now
|
// screen is a circular buffer now
|
||||||
cells2 = &(ty->screen[ty->circular_offset * ty->w]);
|
cells2 = &(ty->screen[ty->circular_offset * ty->w]);
|
||||||
|
if (clear)
|
||||||
_text_clear(ty, cells2, ty->w, 0, EINA_TRUE);
|
_text_clear(ty, cells2, ty->w, 0, EINA_TRUE);
|
||||||
|
|
||||||
ty->circular_offset++;
|
ty->circular_offset++;
|
||||||
|
@ -104,6 +102,7 @@ _termpty_text_scroll(Termpty *ty, Eina_Bool clear)
|
||||||
cells2 = &(ty->screen[(y + 1) * ty->w]);
|
cells2 = &(ty->screen[(y + 1) * ty->w]);
|
||||||
termpty_cell_copy(ty, cells2, cells, ty->w);
|
termpty_cell_copy(ty, cells2, cells, ty->w);
|
||||||
}
|
}
|
||||||
|
if (clear)
|
||||||
_text_clear(ty, cells2, ty->w, 0, EINA_TRUE);
|
_text_clear(ty, cells2, ty->w, 0, EINA_TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -121,9 +120,6 @@ _termpty_text_scroll_rev(Termpty *ty, Eina_Bool clear)
|
||||||
}
|
}
|
||||||
DBG("... scroll rev!!!!! [%i->%i]", start_y, end_y);
|
DBG("... scroll rev!!!!! [%i->%i]", start_y, end_y);
|
||||||
|
|
||||||
if (!clear)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (start_y == 0 && end_y == ty->h - 1)
|
if (start_y == 0 && end_y == ty->h - 1)
|
||||||
{
|
{
|
||||||
// screen is a circular buffer now
|
// screen is a circular buffer now
|
||||||
|
@ -132,6 +128,7 @@ _termpty_text_scroll_rev(Termpty *ty, Eina_Bool clear)
|
||||||
ty->circular_offset = ty->h - 1;
|
ty->circular_offset = ty->h - 1;
|
||||||
|
|
||||||
cells = &(ty->screen[ty->circular_offset * ty->w]);
|
cells = &(ty->screen[ty->circular_offset * ty->w]);
|
||||||
|
if (clear)
|
||||||
_text_clear(ty, cells, ty->w, 0, EINA_TRUE);
|
_text_clear(ty, cells, ty->w, 0, EINA_TRUE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -144,6 +141,7 @@ _termpty_text_scroll_rev(Termpty *ty, Eina_Bool clear)
|
||||||
termpty_cell_copy(ty, cells, cells2, ty->w);
|
termpty_cell_copy(ty, cells, cells2, ty->w);
|
||||||
}
|
}
|
||||||
y = start_y;
|
y = start_y;
|
||||||
|
if (clear)
|
||||||
_text_clear(ty, cells, ty->w, 0, EINA_TRUE);
|
_text_clear(ty, cells, ty->w, 0, EINA_TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue