handle horizontal tabs in the grid

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2014-12-16 14:26:03 -05:00
parent 4079b92440
commit 7fd14b1b07
1 changed files with 10 additions and 0 deletions

View File

@ -869,6 +869,15 @@ _cursor_handle(Grid *sd, const Eina_Unicode *cc)
sd->state.cx = 0;
sd->state.had_cr = 1;
return;
case 0x09: // HT '\t' (horizontal tab)
sd->state.had_cr = 0;
GRID_CELLS(sd, sd->state.cx, sd->state.cy).att.tab = 1;
sd->state.wrapnext = 0;
sd->state.cx += 8;
sd->state.cx = (sd->state.cx / 8) * 8;
if (sd->state.cx >= sd->w)
sd->state.cx = (sd->w - 1);
return;
default:
break;
}
@ -961,6 +970,7 @@ _seq_handle(Grid *sd, Eina_Unicode *c, Eina_Unicode *ce)
{
case 0x0a: // LF '\n' (new line);
case 0x0d: // CR '\r' (carriage return)
case 0x09: // HT '\t' (horizontal tab)
_cursor_handle(sd, c);
return 1;
default: