compat: add margin top support on Origin mode
This commit is contained in:
parent
4daccf1fe4
commit
16e143f970
|
@ -77,6 +77,7 @@ struct _Termstate
|
||||||
unsigned char chset[4];
|
unsigned char chset[4];
|
||||||
int scroll_y1, scroll_y2;
|
int scroll_y1, scroll_y2;
|
||||||
int had_cr_x, had_cr_y;
|
int had_cr_x, had_cr_y;
|
||||||
|
int margin_top; // soon, more to come...
|
||||||
unsigned int multibyte : 1;
|
unsigned int multibyte : 1;
|
||||||
unsigned int alt_kp : 1;
|
unsigned int alt_kp : 1;
|
||||||
unsigned int insert : 1;
|
unsigned int insert : 1;
|
||||||
|
|
|
@ -361,9 +361,9 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
|
||||||
arg--;
|
arg--;
|
||||||
if (arg < 0) arg = 0;
|
if (arg < 0) arg = 0;
|
||||||
else if (arg >= ty->h) arg = ty->h - 1;
|
else if (arg >= ty->h) arg = ty->h - 1;
|
||||||
if (b) ty->state.cy = arg;
|
|
||||||
if (b)
|
if (b)
|
||||||
{
|
{
|
||||||
|
ty->state.cy = arg;
|
||||||
arg = _csi_arg_get(&b);
|
arg = _csi_arg_get(&b);
|
||||||
if (arg < 1) arg = 1;
|
if (arg < 1) arg = 1;
|
||||||
arg--;
|
arg--;
|
||||||
|
@ -373,6 +373,7 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
|
||||||
else if (arg >= ty->w) arg = ty->w - 1;
|
else if (arg >= ty->w) arg = ty->w - 1;
|
||||||
if (b) ty->state.cx = arg;
|
if (b) ty->state.cx = arg;
|
||||||
}
|
}
|
||||||
|
ty->state.cy += ty->state.margin_top;
|
||||||
break;
|
break;
|
||||||
case 'G': // to column N
|
case 'G': // to column N
|
||||||
arg = _csi_arg_get(&b);
|
arg = _csi_arg_get(&b);
|
||||||
|
@ -566,6 +567,8 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
|
||||||
2 + (mode ? 132 : 80) * w,
|
2 + (mode ? 132 : 80) * w,
|
||||||
2 + 24 * h);
|
2 + 24 * h);
|
||||||
termpty_resize(ty, mode ? 132 : 80, 24);
|
termpty_resize(ty, mode ? 132 : 80, 24);
|
||||||
|
_termpty_reset_state(ty);
|
||||||
|
_termpty_clear_screen(ty, TERMPTY_CLR_ALL);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
@ -579,9 +582,20 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
handled = 1;
|
handled = 1;
|
||||||
ERR("TODO: origin mode: cursor is at 0,0"
|
if (mode)
|
||||||
|
{
|
||||||
|
ty->state.margin_top = ty->state.cy;
|
||||||
|
ty->state.cx = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ty->state.cx = 0;
|
||||||
|
ty->state.margin_top = 0;
|
||||||
|
}
|
||||||
|
DBG("XXX: origin mode (%d): cursor is at 0,0"
|
||||||
"cursor limited to screen/start point"
|
"cursor limited to screen/start point"
|
||||||
" for line #'s depends on top margin");
|
" for line #'s depends on top margin",
|
||||||
|
mode);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
handled = 1;
|
handled = 1;
|
||||||
|
|
Loading…
Reference in New Issue