diff options
author | kstailey <kstailey@cvs.openbsd.org> | 1997-07-10 23:12:20 +0000 |
---|---|---|
committer | kstailey <kstailey@cvs.openbsd.org> | 1997-07-10 23:12:20 +0000 |
commit | 73a75656f1872be30066976899d91218f11a78d4 (patch) | |
tree | 9c01b2a46ee23e50dd2136bd70f239f98205c80d /sys/dev/wscons | |
parent | 0826c0a0161aae0be113fb06ba0a48642830c9b9 (diff) |
add insert char capability (and no bickering about it being ANSI 8c{)]
Diffstat (limited to 'sys/dev/wscons')
-rw-r--r-- | sys/dev/wscons/wscons_emul.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/dev/wscons/wscons_emul.c b/sys/dev/wscons/wscons_emul.c index 2da6f03048b..aafe9fb3d4b 100644 --- a/sys/dev/wscons/wscons_emul.c +++ b/sys/dev/wscons/wscons_emul.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wscons_emul.c,v 1.5 1997/04/08 23:30:26 michaels Exp $ */ +/* $OpenBSD: wscons_emul.c,v 1.6 1997/07/10 23:12:19 kstailey Exp $ */ /* $NetBSD: wscons_emul.c,v 1.7 1996/11/19 05:23:13 cgd Exp $ */ /* @@ -347,6 +347,26 @@ wscons_emul_docontrol(we, c) break; } break; + case '@': /* Insert Char */ + { + int copy_src, copy_dst, copy_ncols; + + n = we->ac_args[0] ? we->ac_args[0] : 1; + n = min(n, we->ac_ncol - we->ac_ccol); + + copy_src = we->ac_ccol; + copy_dst = we->ac_ccol + n; + copy_ncols = we->ac_ncol - copy_src - 1; + if (copy_ncols > 0) + (*we->ac_ef->wef_copycols)(we->ac_efa, + we->ac_crow, copy_src, copy_dst, + copy_ncols); + + (*we->ac_ef->wef_erasecols)(we->ac_efa, + we->ac_crow, we->ac_ccol, + we->ac_ncol - (we->ac_ccol + copy_ncols)); + } + break; } } |