insert mode bug fix and cleanup
authorEdward Wang <edward@ucbvax.Berkeley.EDU>
Thu, 24 Aug 1989 12:43:49 +0000 (04:43 -0800)
committerEdward Wang <edward@ucbvax.Berkeley.EDU>
Thu, 24 Aug 1989 12:43:49 +0000 (04:43 -0800)
SCCS-vsn: usr.bin/window/wwinschar.c 3.18
SCCS-vsn: usr.bin/window/ttgeneric.c 3.40
SCCS-vsn: usr.bin/window/tth19.c 3.22
SCCS-vsn: usr.bin/window/tt.h 3.23
SCCS-vsn: usr.bin/window/wwupdate.c 3.26
SCCS-vsn: usr.bin/window/wwwrite.c 3.30
SCCS-vsn: usr.bin/window/wwinit.c 3.35
SCCS-vsn: usr.bin/window/xx.c 3.2
SCCS-vsn: usr.bin/window/xx.h 3.2
SCCS-vsn: usr.bin/window/xxflush.c 3.2
SCCS-vsn: usr.bin/window/ttzapple.c 3.5

usr/src/usr.bin/window/tt.h
usr/src/usr.bin/window/ttgeneric.c
usr/src/usr.bin/window/tth19.c
usr/src/usr.bin/window/ttzapple.c
usr/src/usr.bin/window/wwinit.c
usr/src/usr.bin/window/wwinschar.c
usr/src/usr.bin/window/wwupdate.c
usr/src/usr.bin/window/wwwrite.c
usr/src/usr.bin/window/xx.c
usr/src/usr.bin/window/xx.h
usr/src/usr.bin/window/xxflush.c

index 4b87c0a..23f82c4 100644 (file)
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)tt.h        3.22 (Berkeley) %G%
+ *     @(#)tt.h        3.23 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -30,6 +30,7 @@ struct tt {
        int (*tt_insline)();
        int (*tt_delline)();
        int (*tt_inschar)();
        int (*tt_insline)();
        int (*tt_delline)();
        int (*tt_inschar)();
+       int (*tt_insspace)();
        int (*tt_delchar)();
        int (*tt_write)();              /* write a whole block */
        int (*tt_putc)();               /* write one character */
        int (*tt_delchar)();
        int (*tt_write)();              /* write a whole block */
        int (*tt_putc)();               /* write one character */
@@ -39,7 +40,6 @@ struct tt {
        int (*tt_scroll_down)();
        int (*tt_scroll_up)();
        int (*tt_setscroll)();          /* set scrolling region */
        int (*tt_scroll_down)();
        int (*tt_scroll_up)();
        int (*tt_setscroll)();          /* set scrolling region */
-       int (*tt_setinsert)();          /* set insert mode */
        int (*tt_setmodes)();           /* set display modes */
        int (*tt_set_token)();          /* define a token */
        int (*tt_put_token)();          /* refer to a defined token */
        int (*tt_setmodes)();           /* set display modes */
        int (*tt_set_token)();          /* define a token */
        int (*tt_put_token)();          /* refer to a defined token */
@@ -48,7 +48,6 @@ struct tt {
        char tt_modes;                  /* the current display modes */
        char tt_nmodes;                 /* the new modes for next write */
        char tt_insert;                 /* currently in insert mode */
        char tt_modes;                  /* the current display modes */
        char tt_nmodes;                 /* the new modes for next write */
        char tt_insert;                 /* currently in insert mode */
-       char tt_ninsert;                /* insert mode on next write */
        int tt_row;                     /* cursor row */
        int tt_col;                     /* cursor column */
        int tt_scroll_top;              /* top of scrolling region */
        int tt_row;                     /* cursor row */
        int tt_col;                     /* cursor column */
        int tt_scroll_top;              /* top of scrolling region */
index 0256ee6..8950d8f 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)ttgeneric.c        3.39 (Berkeley) %G%";
+static char sccsid[] = "@(#)ttgeneric.c        3.40 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "ww.h"
 #endif /* not lint */
 
 #include "ww.h"
@@ -178,18 +178,11 @@ gen_delline(n)
 gen_putc(c)
 register char c;
 {
 gen_putc(c)
 register char c;
 {
-       if (tt.tt_ninsert != tt.tt_insert)
-               gen_setinsert(tt.tt_ninsert);
+       if (tt.tt_insert)
+               gen_setinsert(0);
        if (tt.tt_nmodes != tt.tt_modes)
                gen_setmodes(tt.tt_nmodes);
        if (tt.tt_nmodes != tt.tt_modes)
                gen_setmodes(tt.tt_nmodes);
-       if (tt.tt_insert) {
-               if (gen_IC)
-                       tttputs(gen_IC, gen_CO - tt.tt_col);
-               ttputc(c);
-               if (gen_IP)
-                       tttputs(gen_IP, gen_CO - tt.tt_col);
-       } else
-               ttputc(c);
+       ttputc(c);
        if (++tt.tt_col == gen_CO)
                if (gen_XN)
                        tt.tt_col = tt.tt_row = -10;
        if (++tt.tt_col == gen_CO)
                if (gen_XN)
                        tt.tt_col = tt.tt_row = -10;
@@ -203,23 +196,12 @@ gen_write(p, n)
        register char *p;
        register n;
 {
        register char *p;
        register n;
 {
-       if (tt.tt_ninsert != tt.tt_insert)
-               gen_setinsert(tt.tt_ninsert);
+       if (tt.tt_insert)
+               gen_setinsert(0);
        if (tt.tt_nmodes != tt.tt_modes)
                gen_setmodes(tt.tt_nmodes);
        if (tt.tt_nmodes != tt.tt_modes)
                gen_setmodes(tt.tt_nmodes);
-       if (tt.tt_insert && (gen_IC || gen_IP)) {
-               while (--n >= 0) {
-                       if (gen_IC)
-                               tttputs(gen_IC, gen_CO - tt.tt_col);
-                       ttputc(*p++);
-                       if (gen_IP)
-                               tttputs(gen_IP, gen_CO - tt.tt_col);
-                       tt.tt_col++;
-               }
-       } else {
-               tt.tt_col += n;
-               ttwrite(p, n);
-       }
+       ttwrite(p, n);
+       tt.tt_col += n;
        if (tt.tt_col == gen_CO)
                if (gen_XN)
                        tt.tt_col = tt.tt_row = -10;
        if (tt.tt_col == gen_CO)
                if (gen_XN)
                        tt.tt_col = tt.tt_row = -10;
@@ -286,12 +268,14 @@ gen_start()
                ttxputs(gen_TI);
        ttxputs(gen_CL);
        tt.tt_col = tt.tt_row = 0;
                ttxputs(gen_TI);
        ttxputs(gen_CL);
        tt.tt_col = tt.tt_row = 0;
-       tt.tt_ninsert = tt.tt_insert = 0;
+       tt.tt_insert = 0;
        tt.tt_nmodes = tt.tt_modes = 0;
 }
 
 gen_end()
 {
        tt.tt_nmodes = tt.tt_modes = 0;
 }
 
 gen_end()
 {
+       if (tt.tt_insert)
+               gen_setinsert(0);
        if (gen_TE)
                ttxputs(gen_TE);
        if (gen_VE)
        if (gen_TE)
                ttxputs(gen_TE);
        if (gen_VE)
@@ -319,7 +303,28 @@ gen_clear()
        ttxputs(gen_CL);
 }
 
        ttxputs(gen_CL);
 }
 
-gen_inschar(n)
+gen_inschar(c)
+register char c;
+{
+       if (!tt.tt_insert)
+               gen_setinsert(1);
+       if (tt.tt_nmodes != tt.tt_modes)
+               gen_setmodes(tt.tt_nmodes);
+       if (gen_IC)
+               tttputs(gen_IC, gen_CO - tt.tt_col);
+       ttputc(c);
+       if (gen_IP)
+               tttputs(gen_IP, gen_CO - tt.tt_col);
+       if (++tt.tt_col == gen_CO)
+               if (gen_XN)
+                       tt.tt_col = tt.tt_row = -10;
+               else if (gen_AM)
+                       tt.tt_col = 0, tt.tt_row++;
+               else
+                       tt.tt_col--;
+}
+
+gen_insspace(n)
 {
        if (gen_ICn)
                ttpgoto(gen_ICn, 0, n, gen_CO - tt.tt_col);
 {
        if (gen_ICn)
                ttpgoto(gen_ICn, 0, n, gen_CO - tt.tt_col);
@@ -465,9 +470,9 @@ tt_generic()
                gen_US = 0;
 
        if (gen_IM)
                gen_US = 0;
 
        if (gen_IM)
-               tt.tt_setinsert = gen_setinsert;
-       else if (gen_IC)
                tt.tt_inschar = gen_inschar;
                tt.tt_inschar = gen_inschar;
+       else if (gen_IC)
+               tt.tt_insspace = gen_insspace;
        if (gen_DC)
                tt.tt_delchar = gen_delchar;
        if (gen_AL)
        if (gen_DC)
                tt.tt_delchar = gen_delchar;
        if (gen_AL)
index 2d32dd3..ab1ebbd 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)tth19.c    3.21 (Berkeley) %G%";
+static char sccsid[] = "@(#)tth19.c    3.22 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "ww.h"
 #endif /* not lint */
 
 #include "ww.h"
@@ -62,11 +62,6 @@ int h19_msp10c;
 
 #define H19_SETINSERT(m) (esc(), (tt.tt_insert = (m)) ? pc('@') : pc('O'))
 
 
 #define H19_SETINSERT(m) (esc(), (tt.tt_insert = (m)) ? pc('@') : pc('O'))
 
-h19_setinsert(new)
-{
-       H19_SETINSERT(new);
-}
-
 h19_setmodes(new)
 register new;
 {
 h19_setmodes(new)
 register new;
 {
@@ -113,11 +108,9 @@ register char c;
 {
        if (tt.tt_nmodes != tt.tt_modes)
                (*tt.tt_setmodes)(tt.tt_nmodes);
 {
        if (tt.tt_nmodes != tt.tt_modes)
                (*tt.tt_setmodes)(tt.tt_nmodes);
-       if (tt.tt_ninsert != tt.tt_insert)
-               H19_SETINSERT(tt.tt_ninsert);
-       pc(c);
        if (tt.tt_insert)
        if (tt.tt_insert)
-               ICPAD();
+               H19_SETINSERT(0);
+       pc(c);
        if (++tt.tt_col == NCOL)
                tt.tt_col = NCOL - 1;
 }
        if (++tt.tt_col == NCOL)
                tt.tt_col = NCOL - 1;
 }
@@ -128,18 +121,10 @@ register n;
 {
        if (tt.tt_nmodes != tt.tt_modes)
                (*tt.tt_setmodes)(tt.tt_nmodes);
 {
        if (tt.tt_nmodes != tt.tt_modes)
                (*tt.tt_setmodes)(tt.tt_nmodes);
-       if (tt.tt_ninsert != tt.tt_insert)
-               H19_SETINSERT(tt.tt_ninsert);
-       if (tt.tt_insert) {
-               while (--n >= 0) {
-                       pc(*p++);
-                       ICPAD();
-                       tt.tt_col++;
-               }
-       } else {
-               tt.tt_col += n;
-               ttwrite(p, n);
-       }
+       if (tt.tt_insert)
+               H19_SETINSERT(0);
+       ttwrite(p, n);
+       tt.tt_col += n;
        if (tt.tt_col == NCOL)
                tt.tt_col = NCOL - 1;
 }
        if (tt.tt_col == NCOL)
                tt.tt_col = NCOL - 1;
 }
@@ -198,12 +183,14 @@ h19_start()
        esc();
        pc('E');
        tt.tt_col = tt.tt_row = 0;
        esc();
        pc('E');
        tt.tt_col = tt.tt_row = 0;
-       tt.tt_ninsert = tt.tt_insert = 0;
+       tt.tt_insert = 0;
        tt.tt_nmodes = tt.tt_modes = 0;
 }
 
 h19_end()
 {
        tt.tt_nmodes = tt.tt_modes = 0;
 }
 
 h19_end()
 {
+       if (tt.tt_insert)
+               H19_SETINSERT(0);
        if (gen_VE)
                ttxputs(gen_VE);
        esc();
        if (gen_VE)
                ttxputs(gen_VE);
        esc();
@@ -228,6 +215,20 @@ h19_clear()
        pc('E');
 }
 
        pc('E');
 }
 
+h19_inschar(c)
+register char c;
+{
+       if (tt.tt_nmodes != tt.tt_modes)
+               (*tt.tt_setmodes)(tt.tt_nmodes);
+       if (!tt.tt_insert)
+               H19_SETINSERT(1);
+       pc(c);
+       if (tt.tt_insert)
+               ICPAD();
+       if (++tt.tt_col == NCOL)
+               tt.tt_col = NCOL - 1;
+}
+
 h19_delchar(n)
 {
        while (--n >= 0) {
 h19_delchar(n)
 {
        while (--n >= 0) {
@@ -265,6 +266,7 @@ tt_h19()
 
        tt.tt_insline = h19_insline;
        tt.tt_delline = h19_delline;
 
        tt.tt_insline = h19_insline;
        tt.tt_delline = h19_delline;
+       tt.tt_inschar = h19_inschar;
        tt.tt_delchar = h19_delchar;
        tt.tt_clreol = h19_clreol;
        tt.tt_clreos = h19_clreos;
        tt.tt_delchar = h19_delchar;
        tt.tt_clreol = h19_clreol;
        tt.tt_clreos = h19_clreos;
@@ -274,7 +276,6 @@ tt_h19()
        tt.tt_putc = h19_putc;
        tt.tt_scroll_down = h19_scroll_down;
        tt.tt_scroll_up = h19_scroll_up;
        tt.tt_putc = h19_putc;
        tt.tt_scroll_down = h19_scroll_down;
        tt.tt_scroll_up = h19_scroll_up;
-       tt.tt_setinsert = h19_setinsert;
        tt.tt_setmodes = h19_setmodes;
 
        tt.tt_ncol = NCOL;
        tt.tt_setmodes = h19_setmodes;
 
        tt.tt_ncol = NCOL;
index 95bafd2..79ea82d 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)ttzapple.c 3.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)ttzapple.c 3.5 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "ww.h"
 #endif /* not lint */
 
 #include "ww.h"
@@ -229,7 +229,7 @@ zz_clear()
        tt.tt_col = tt.tt_row = 0;
 }
 
        tt.tt_col = tt.tt_row = 0;
 }
 
-zz_inschar(n)
+zz_insspace(n)
 {
        if (n != 1) {
                esc1();
 {
        if (n != 1) {
                esc1();
@@ -334,7 +334,7 @@ zz_put_token(t, s, n)
 
 tt_zapple()
 {
 
 tt_zapple()
 {
-       tt.tt_inschar = zz_inschar;
+       tt.tt_insspace = zz_insspace;
        tt.tt_delchar = zz_delchar;
        tt.tt_insline = zz_insline;
        tt.tt_delline = zz_delline;
        tt.tt_delchar = zz_delchar;
        tt.tt_insline = zz_insline;
        tt.tt_delline = zz_delline;
index a7ad7b7..be9bfcb 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)wwinit.c   3.34 (Berkeley) %G%";
+static char sccsid[] = "@(#)wwinit.c   3.35 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "ww.h"
 #endif /* not lint */
 
 #include "ww.h"
@@ -150,7 +150,7 @@ wwinit()
                wwaddcap1(WWT_USR, &kp);
        if (tt.tt_insline && tt.tt_delline || tt.tt_setscroll)
                wwaddcap1(WWT_ALDL, &kp);
                wwaddcap1(WWT_USR, &kp);
        if (tt.tt_insline && tt.tt_delline || tt.tt_setscroll)
                wwaddcap1(WWT_ALDL, &kp);
-       if (tt.tt_inschar || tt.tt_setinsert)
+       if (tt.tt_inschar || tt.tt_insspace)
                wwaddcap1(WWT_IMEI, &kp);
        if (tt.tt_delchar)
                wwaddcap1(WWT_DC, &kp);
                wwaddcap1(WWT_IMEI, &kp);
        if (tt.tt_delchar)
                wwaddcap1(WWT_DC, &kp);
index ebb1fac..715a2da 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)wwinschar.c        3.17 (Berkeley) %G%";
+static char sccsid[] = "@(#)wwinschar.c        3.18 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "ww.h"
 #endif /* not lint */
 
 #include "ww.h"
index 2b37e1d..5fda014 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)wwupdate.c 3.25 (Berkeley) %G%";
+static char sccsid[] = "@(#)wwupdate.c 3.26 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "ww.h"
 #endif /* not lint */
 
 #include "ww.h"
@@ -221,28 +221,25 @@ simple:
                        }
                        if (wwwrap
                            && i == wwnrow - 1 && q - buf + c == wwncol) {
                        }
                        if (wwwrap
                            && i == wwnrow - 1 && q - buf + c == wwncol) {
-                               if (tt.tt_setinsert) {
+                               if (tt.tt_inschar) {
                                        if (q - buf != 1) {
                                                xxwrite(i, c, buf + 1,
                                                        q - buf - 1, m);
                                        if (q - buf != 1) {
                                                xxwrite(i, c, buf + 1,
                                                        q - buf - 1, m);
-                                               xxinschar(i, c, *buf |
-                                                       m << WWC_MSHIFT);
+                                               xxinschar(i, c, *buf, m);
                                        } else {
                                                xxwrite(i, c - 1, buf, 1, m);
                                                xxinschar(i, c - 1,
                                        } else {
                                                xxwrite(i, c - 1, buf, 1, m);
                                                xxinschar(i, c - 1,
-                                                       ns[-2].c_w);
+                                                       ns[-2].c_c, ns[-2].c_m);
                                        }
                                        }
-                               } else if (tt.tt_inschar) {
+                               } else if (tt.tt_insspace) {
                                        if (q - buf != 1) {
                                                xxwrite(i, c, buf + 1,
                                                        q - buf - 1, m);
                                        if (q - buf != 1) {
                                                xxwrite(i, c, buf + 1,
                                                        q - buf - 1, m);
-                                               xxinschar(i, c, *buf |
-                                                       m << WWC_MSHIFT);
+                                               xxinsspace(i, c);
                                                xxwrite(i, c, buf, 1, m);
                                        } else {
                                                xxwrite(i, c - 1, buf, 1, m);
                                                xxwrite(i, c, buf, 1, m);
                                        } else {
                                                xxwrite(i, c - 1, buf, 1, m);
-                                               xxinschar(i, c - 1,
-                                                       ns[-2].c_w);
+                                               xxinsspace(i, c - 1);
                                                xxwrite(i, c - 1, &ns[-2].c_c,
                                                        1, ns[-2].c_m);
                                        }
                                                xxwrite(i, c - 1, &ns[-2].c_c,
                                                        1, ns[-2].c_m);
                                        }
index 50b68af..90cf59b 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)wwwrite.c  3.29 (Berkeley) %G%";
+static char sccsid[] = "@(#)wwwrite.c  3.30 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "ww.h"
 #endif /* not lint */
 
 #include "ww.h"
@@ -80,7 +80,7 @@ int n;
                                        q = p + 10;
                                }
                                wwinschar(w, w->ww_cur.r, w->ww_cur.c,
                                        q = p + 10;
                                }
                                wwinschar(w, w->ww_cur.r, w->ww_cur.c,
-                                       *p++ | w->ww_modes << WWC_MSHIFT);
+                                       *p++, w->ww_modes);
                                goto right;
                        }
 
                                goto right;
                        }
 
index d69d890..69382b9 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)xx.c       3.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)xx.c       3.2 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "ww.h"
 #endif /* not lint */
 
 #include "ww.h"
@@ -53,8 +53,6 @@ xxend()
        if (tt.tt_scroll_top != 0 || tt.tt_scroll_bot != tt.tt_nrow - 1)
                /* tt.tt_setscroll is known to be defined */
                (*tt.tt_setscroll)(0, tt.tt_nrow - 1);
        if (tt.tt_scroll_top != 0 || tt.tt_scroll_bot != tt.tt_nrow - 1)
                /* tt.tt_setscroll is known to be defined */
                (*tt.tt_setscroll)(0, tt.tt_nrow - 1);
-       if (tt.tt_insert)
-               (*tt.tt_setinsert)(0);
        if (tt.tt_modes)
                (*tt.tt_setmodes)(0);
        if (tt.tt_scroll_down)
        if (tt.tt_modes)
                (*tt.tt_setmodes)(0);
        if (tt.tt_scroll_down)
@@ -121,28 +119,32 @@ xxscroll(dir, top, bot)
        xp->arg2 = bot;
 }
 
        xp->arg2 = bot;
 }
 
-xxinschar(row, col, c)
+xxinschar(row, col, c, m)
+{
+       register struct xx *xp;
+
+       xp = xxalloc();
+       xp->cmd = xc_inschar;
+       xp->arg0 = row;
+       xp->arg1 = col;
+       xp->arg2 = c;
+       xp->arg3 = m;
+}
+
+xxinsspace(row, col)
 {
        register struct xx *xp = xx_tail;
 {
        register struct xx *xp = xx_tail;
-       int m = c >> WWC_MSHIFT;
 
 
-       if (xxbufp >= xxbufe)
-               xxflush(0);
-       c &= WWC_CMASK;
-       if (xp != 0 && xp->cmd == xc_inschar &&
-           xp->arg0 == row && xp->arg1 + xp->arg2 == col && xp->arg3 == m) {
-               xp->buf[xp->arg2++] = c;
-               xxbufp++;
+       if (xp != 0 && xp->cmd == xc_insspace && xp->arg0 == row &&
+           col >= xp->arg1 && col <= xp->arg1 + xp->arg2) {
+               xp->arg2++;
                return;
        }
        xp = xxalloc();
                return;
        }
        xp = xxalloc();
-       xp->cmd = xc_inschar;
+       xp->cmd = xc_insspace;
        xp->arg0 = row;
        xp->arg1 = col;
        xp->arg2 = 1;
        xp->arg0 = row;
        xp->arg1 = col;
        xp->arg2 = 1;
-       xp->arg3 = m;
-       xp->buf = xxbufp++;
-       *xp->buf = c;
 }
 
 xxdelchar(row, col)
 }
 
 xxdelchar(row, col)
index 34d38f2..a7e9add 100644 (file)
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)xx.h        3.1 (Berkeley) %G%
+ *     @(#)xx.h        3.2 (Berkeley) %G%
  */
 
 struct xx {
  */
 
 struct xx {
-       enum { xc_move, xc_scroll, xc_delchar, xc_inschar, xc_clear, xc_clreos,
-               xc_clreol, xc_write } cmd;
+       enum { xc_move, xc_scroll, xc_inschar, xc_insspace, xc_delchar,
+               xc_clear, xc_clreos, xc_clreol, xc_write } cmd;
        int arg0;
        int arg1;
        int arg2;
        int arg0;
        int arg1;
        int arg2;
index 0067fbd..d286e39 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)xxflush.c  3.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)xxflush.c  3.2 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "ww.h"
 #endif /* not lint */
 
 #include "ww.h"
@@ -38,20 +38,15 @@ xxflush(intr)
                        xxflush_scroll(xp);
                        break;
                case xc_inschar:
                        xxflush_scroll(xp);
                        break;
                case xc_inschar:
-                       if (xp->arg1 + xp->arg2 >= tt.tt_ncol)
-                               break;
                        (*tt.tt_move)(xp->arg0, xp->arg1);
                        (*tt.tt_move)(xp->arg0, xp->arg1);
-                       if (tt.tt_setinsert) {
-                               tt.tt_nmodes = xp->arg3;
-                               tt.tt_ninsert = 1;
-                               (*tt.tt_write)(xp->buf, xp->arg2);
-                               tt.tt_ninsert = 0;
-                       } else
-                               (*tt.tt_inschar)(xp->arg2);
+                       tt.tt_nmodes = xp->arg3;
+                       (*tt.tt_inschar)(xp->arg2);
+                       break;
+               case xc_insspace:
+                       (*tt.tt_move)(xp->arg0, xp->arg1);
+                       (*tt.tt_insspace)(xp->arg2);
                        break;
                case xc_delchar:
                        break;
                case xc_delchar:
-                       if (xp->arg1 + xp->arg2 >= tt.tt_ncol)
-                               break;
                        (*tt.tt_move)(xp->arg0, xp->arg1);
                        (*tt.tt_delchar)(xp->arg2);
                        break;
                        (*tt.tt_move)(xp->arg0, xp->arg1);
                        (*tt.tt_delchar)(xp->arg2);
                        break;