diff options
author | james <> | 2008-02-06 11:49:47 +0000 |
---|---|---|
committer | james <> | 2008-02-06 11:49:47 +0000 |
commit | e18a0076cdd7336517dd9853a79335de0fb5cc22 (patch) | |
tree | 0204d9fb048ce8f4317c6a77d6ac7b85277fd697 /src/vt102.c | |
parent | 8e3109cc4dc4d969084fe455c549f9422d73b5c0 (diff) | |
download | sympathy-e18a0076cdd7336517dd9853a79335de0fb5cc22.tar.gz sympathy-e18a0076cdd7336517dd9853a79335de0fb5cc22.tar.bz2 sympathy-e18a0076cdd7336517dd9853a79335de0fb5cc22.zip |
*** empty log message ***
Diffstat (limited to 'src/vt102.c')
-rw-r--r-- | src/vt102.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/vt102.c b/src/vt102.c index 8b61929..1649c4f 100644 --- a/src/vt102.c +++ b/src/vt102.c @@ -10,6 +10,9 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.8 2008/02/06 11:49:47 james + * *** empty log message *** + * * Revision 1.7 2008/02/06 11:30:37 james * *** empty log message *** * @@ -244,6 +247,25 @@ vt102_delete_from_line (VT102 * v, CRT_Pos p) } void +vt102_insert_into_line (VT102 * v, CRT_Pos p) +{ + int n = v->bottom_margin.x - p.x; + + if (n < 0) + return; + + if (n) + { + + memmove (&v->crt.screen[CRT_ADDR_POS (&p) + 1], + &v->crt.screen[CRT_ADDR_POS (&p) ], sizeof (CRT_CA) * n); + } + + v->crt.screen[CRT_ADDR (p.y, v->bottom_margin.x)].chr = ' '; + v->crt.screen[CRT_ADDR (p.y, v->bottom_margin.x)].attr = CRT_ATTR_NORMAL; +} + +void vt102_change_mode (VT102 * v, int private, char *ns, int set) { int m; @@ -566,6 +588,8 @@ vt102_parse_char (VT102 * v, int c) /*VT*/ case 11: /*FF*/ case 12: vt102_cursor_motion (v, 0, 1, 1); + if (v->modes[VT102_MODE_NEWLINE_MODE]) + v->pos.x = v->top_margin.x; break; /*CR*/ case 13: v->pos.x = v->top_margin.x; @@ -594,6 +618,10 @@ vt102_parse_char (VT102 * v, int c) /*DEL*/ case 127: break; /*regular character */ default: + + if (v->modes[VT102_MODE_INSERT]) + vt102_insert_into_line(v,v->pos); + v->crt.screen[CRT_ADDR_POS (&v->pos)].chr = c; v->crt.screen[CRT_ADDR_POS (&v->pos)].attr = v->attr; vt102_cursor_motion (v, 1, 0, 1); @@ -632,4 +660,11 @@ vt102_reset (VT102 * v) v->pos = v->screen_start; + memset(v->modes,0,VT102_NMODES); + memset(v->private_modes,0,VT102_NMODES); + + v->modes[VT102_PRIVATE_MODE_AUTO_WRAP]=1; + v->modes[VT102_PRIVATE_MODE_AUTO_REPEAT]=1; + + } |