termpty: remove termstate.had_cr since it's unused

terminology-1.1
Boris Faure 6 years ago
parent 2343efd6a1
commit 6315ed2949
  1. 1
      src/bin/termpty.c
  2. 1
      src/bin/termpty.h
  3. 25
      src/bin/termptyesc.c
  4. 1
      src/bin/termptyops.c

@ -1332,7 +1332,6 @@ termpty_resize(Termpty *ty, int new_w, int new_h)
ty->w = new_w;
ty->h = new_h;
ty->termstate.had_cr = 0;
ty->termstate.wrapnext = 0;
if (altbuf)

@ -146,7 +146,6 @@ struct _Termpty
unsigned int wrap : 1;
unsigned int wrapnext : 1;
unsigned int crlf : 1;
unsigned int had_cr : 1;
unsigned int send_bs : 1;
unsigned int kbd_lock : 1;
unsigned int reverse : 1;

@ -156,12 +156,10 @@ _handle_cursor_control(Termpty *ty, const Eina_Unicode *cc)
switch (*cc)
{
case 0x07: // BEL '\a' (bell)
ty->termstate.had_cr = 0;
if (ty->cb.bell.func) ty->cb.bell.func(ty->cb.bell.data);
return;
case 0x08: // BS '\b' (backspace)
DBG("->BS");
ty->termstate.had_cr = 0;
ty->termstate.wrapnext = 0;
ty->cursor_state.cx--;
TERMPTY_RESTRICT_FIELD(ty->cursor_state.cx, 0, ty->w);
@ -169,18 +167,11 @@ _handle_cursor_control(Termpty *ty, const Eina_Unicode *cc)
case 0x09: // HT '\t' (horizontal tab)
DBG("->HT");
_tab_forward(ty, 1);
ty->termstate.had_cr = 0;
return;
case 0x0a: // LF '\n' (new line)
case 0x0b: // VT '\v' (vertical tab)
case 0x0c: // FF '\f' (form feed)
DBG("->LF");
if (ty->termstate.had_cr)
{
TERMPTY_SCREEN(ty, ty->termstate.had_cr_x,
ty->termstate.had_cr_y).att.newline = 1;
}
ty->termstate.had_cr = 0;
ty->termstate.wrapnext = 0;
if (ty->termstate.crlf) ty->cursor_state.cx = 0;
ty->cursor_state.cy++;
@ -195,7 +186,6 @@ _handle_cursor_control(Termpty *ty, const Eina_Unicode *cc)
ty->termstate.wrapnext = 0;
}
ty->cursor_state.cx = 0;
// ty->termstate.had_cr = 1;
return;
default:
return;
@ -2083,7 +2073,6 @@ termpty_handle_seq(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
/*
case 0x05: // ENQ (enquiry)
_term_txt_write(ty, "ABC\r\n");
ty->termstate.had_cr = 0;
return 1;
*/
/*
@ -2101,13 +2090,11 @@ termpty_handle_seq(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
return 1;
case 0x0e: // SO (shift out) // Maps G1 character set into GL.
ty->termstate.had_cr = 0;
ty->termstate.charset = 1;
ty->termstate.charsetch = ty->termstate.chset[1];
return 1;
case 0x0f: // SI (shift in) // Maps G0 character set into GL.
ty->termstate.charset = 0;
ty->termstate.had_cr = 0;
ty->termstate.charsetch = ty->termstate.chset[0];
return 1;
/*
@ -2135,7 +2122,6 @@ termpty_handle_seq(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
return 1;
*/
case 0x1b: // ESC (escape)
ty->termstate.had_cr = 0;
len = _handle_esc(ty, c + 1, ce);
if (len == 0) return 0;
return 1 + len;
@ -2150,20 +2136,17 @@ termpty_handle_seq(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
return 1;
*/
default:
ty->termstate.had_cr = 0;
//ERR("unhandled char 0x%02x", c[0]);
return 1;
}
}
else if (c[0] == 0x7f) // DEL
{
ty->termstate.had_cr = 0;
WRN("Unhandled char 0x%02x [DEL]", (unsigned int) c[0]);
return 1;
}
else if (c[0] == 0x9b) // ANSI ESC!!!
{
ty->termstate.had_cr = 0;
DBG("ANSI CSI!!!!!");
len = _handle_esc_csi(ty, c + 1, ce);
if (len == 0) return 0;
@ -2173,8 +2156,7 @@ termpty_handle_seq(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
{
Termexp *ex;
Eina_List *l;
ty->termstate.had_cr = 0;
EINA_LIST_FOREACH(ty->block.expecting, l, ex)
{
if (c[0] == ex->ch)
@ -2206,10 +2188,6 @@ termpty_handle_seq(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
termpty_text_append(ty, c, 1);
return 1;
}
else
{
ty->termstate.had_cr = 0;
}
cc = (Eina_Unicode *)c;
DBG("txt: [");
while ((cc < ce) && (*cc >= 0x20) && (*cc != 0x7f))
@ -2220,6 +2198,5 @@ termpty_handle_seq(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
}
DBG("]");
termpty_text_append(ty, c, len);
ty->termstate.had_cr = 0;
return len;
}

@ -439,7 +439,6 @@ termpty_reset_state(Termpty *ty)
ty->termstate.wrap = 1;
ty->termstate.wrapnext = 0;
ty->termstate.crlf = 0;
ty->termstate.had_cr = 0;
ty->termstate.send_bs = 0;
ty->termstate.reverse = 0;
ty->termstate.no_autorepeat = 0;

Loading…
Cancel
Save