date and time created 83/08/11 17:21:55 by edward
[unix-history] / usr / src / usr.bin / window / wwinschar.c
CommitLineData
bc28423e
EW
1#ifndef lint
2static char *sccsid = "@(#)wwinschar.c 3.1 83/08/09";
3#endif
4
5#include "ww.h"
6
7wwinschar(w, n)
8register struct ww *w;
9register n;
10{
11 register i, j;
12 int col, row;
13
14 col = w->ww_cur.c + w->ww_w.l;
15 row = w->ww_cur.r + w->ww_w.t;
16 for (i = col; i < wwncol;) {
17 for (j = i; j < wwncol && wwsmap[row][j] == w->ww_index; j++)
18 ;
19 if (j > i) {
20 if (j <= i + n) {
21 if (j == wwncol) {
22 (*tt.tt_clreol)(w);
23 } else {
24 (*tt.tt_blank)(j);
25 (*tt.tt_move)(row, col);
26 }
27 } else {
28 if (j < wwncol) {
29 (*tt.tt_move)(row, j - n);
30 (*tt.tt_delchar)(n);
31 (*tt.tt_move)(row, col);
32 }
33 (*tt.tt_setinsert)(1);
34 (*tt.tt_blank)(n);
35 }
36 }
37 for (i = j; i < wwncol && wwsmap[row][i] != w->ww_index; i++)
38 ;
39 }
40 (*tt.tt_setinsert)(0);
41}