From 0e64e42293a904a6e3adf2de26bbbd16d8c6711c Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Sun, 8 Apr 1984 19:08:45 -0800 Subject: [PATCH] control character expansion in wwwrite() calling of wwupdate() in wwwrite() dependent of ww_noupdate control character handling macros in char.h SCCS-vsn: usr.bin/window/main.c 3.21 SCCS-vsn: usr.bin/window/wwinit.c 3.17 SCCS-vsn: usr.bin/window/wwmisc.c 3.6 SCCS-vsn: usr.bin/window/ww.h 3.28 SCCS-vsn: usr.bin/window/cmd.c 3.27 SCCS-vsn: usr.bin/window/cmd1.c 3.23 SCCS-vsn: usr.bin/window/wwwrite.c 3.19 SCCS-vsn: usr.bin/window/wwgets.c 3.5 SCCS-vsn: usr.bin/window/cmd2.c 3.27 SCCS-vsn: usr.bin/window/wwlabel.c 3.11 SCCS-vsn: usr.bin/window/startup.c 3.10 SCCS-vsn: usr.bin/window/error.c 3.8 SCCS-vsn: usr.bin/window/:ww 1.8 SCCS-vsn: usr.bin/window/cmd6.c 3.9 SCCS-vsn: usr.bin/window/lcmd1.c 3.21 SCCS-vsn: usr.bin/window/win.c 3.7 --- usr/src/usr.bin/window/:ww | 8 +++-- usr/src/usr.bin/window/cmd.c | 49 ++++++++++++------------- usr/src/usr.bin/window/cmd1.c | 7 ++-- usr/src/usr.bin/window/cmd2.c | 6 ++-- usr/src/usr.bin/window/cmd6.c | 5 +-- usr/src/usr.bin/window/error.c | 5 +-- usr/src/usr.bin/window/lcmd1.c | 8 +++-- usr/src/usr.bin/window/main.c | 6 ++-- usr/src/usr.bin/window/startup.c | 7 ++-- usr/src/usr.bin/window/win.c | 14 ++++++-- usr/src/usr.bin/window/ww.h | 34 +++++++++--------- usr/src/usr.bin/window/wwgets.c | 9 ++--- usr/src/usr.bin/window/wwinit.c | 3 +- usr/src/usr.bin/window/wwlabel.c | 3 +- usr/src/usr.bin/window/wwmisc.c | 27 +------------- usr/src/usr.bin/window/wwwrite.c | 62 +++++++++++++++++++++++++------- 16 files changed, 144 insertions(+), 109 deletions(-) diff --git a/usr/src/usr.bin/window/:ww b/usr/src/usr.bin/window/:ww index 7bc504c452..9c8825e605 100644 --- a/usr/src/usr.bin/window/:ww +++ b/usr/src/usr.bin/window/:ww @@ -1,5 +1,4 @@ -./"forw"16t"back"16t"state"8t"wstate"8t"modes"nppbbb -+/"xxx"8t"index"8t"order"nbbb++ +./"forw"16t"back"16t"state"8t"index"8t"order"nppbbb+ +/"w.nr"16t"w.nc"nDD +/"w.t"16t"w.b"16t"w.l"16t"w.r"nDDDD +/"b.nr"16t"b.nc"nDD @@ -8,6 +7,9 @@ +/"i.t"16t"i.b"16t"i.l"16t"i.r"nDDDD +/"cur.r"16t"cur.c"nDD +/"win"16t"buf"16t"fmap"16t"nvis"npppp ++/"wstate"8t"modes"8t"insert"8t"mapnl"8t"noupd"n5b ++/"unctrl"8t"nointr"8t"hascurs"8t"hasframe"n4b3+ +/"pty"16t"pid"16t"ttyname"nDD11C+ +/"ob"16t"obe"16t"obp"16t"obc"n3pD -+/"stopped"nb ++/"stopped"nb3+ ++/"center"8t"id"8t"label"16t"altpos.r"16t"altpos.c"n2b2+pDD diff --git a/usr/src/usr.bin/window/cmd.c b/usr/src/usr.bin/window/cmd.c index 0345a50367..8da2c1783f 100644 --- a/usr/src/usr.bin/window/cmd.c +++ b/usr/src/usr.bin/window/cmd.c @@ -1,8 +1,9 @@ #ifndef lint -static char *sccsid = "@(#)cmd.c 3.26 84/04/07"; +static char *sccsid = "@(#)cmd.c 3.27 84/04/08"; #endif #include "defs.h" +#include "char.h" docmd() { @@ -20,15 +21,15 @@ docmd() goto foo; break; case 'h': case 'j': case 'k': case 'l': - case CTRL(y): - case CTRL(e): - case CTRL(u): - case CTRL(d): - case CTRL(b): - case CTRL(f): - case CTRL(s): - case CTRL(q): - case CTRL([): + case ctrl(y): + case ctrl(e): + case ctrl(u): + case ctrl(d): + case ctrl(b): + case ctrl(f): + case ctrl(s): + case ctrl(q): + case ctrl([): foo: if (selwin == 0) { error("No window."); @@ -50,7 +51,7 @@ docmd() if ((w = getwin()) != 0) setselwin(w); break; - case CTRL(^): + case ctrl(^): if (lastselwin != 0) { setselwin(lastselwin); if (checkproc(selwin) >= 0) @@ -89,43 +90,43 @@ docmd() case 'l': (void) wwwrite(selwin, "\033C", 2); break; - case CTRL(e): + case ctrl(e): wwscroll(selwin, 1); break; - case CTRL(y): + case ctrl(y): wwscroll(selwin, -1); break; - case CTRL(d): + case ctrl(d): wwscroll(selwin, selwin->ww_w.nr / 2); break; - case CTRL(u): + case ctrl(u): wwscroll(selwin, - selwin->ww_w.nr / 2); break; - case CTRL(f): + case ctrl(f): wwscroll(selwin, selwin->ww_w.nr); break; - case CTRL(b): + case ctrl(b): wwscroll(selwin, - selwin->ww_w.nr); break; - case CTRL(s): + case ctrl(s): (void) write(selwin->ww_pty, &wwwintty.ww_tchars.t_stopc, 1); break; - case CTRL(q): + case ctrl(q): (void) write(selwin->ww_pty, &wwwintty.ww_tchars.t_startc, 1); break; - case CTRL(l): + case ctrl(l): wwredraw(); break; case '?': c_help(); break; - case CTRL([): + case ctrl([): if (checkproc(selwin) >= 0) out = 1; break; - case CTRL(z): + case ctrl(z): wwsuspend(); break; case 'q': @@ -146,7 +147,7 @@ docmd() } } else { if (!terse) - wwputc(CTRL(g), cmdwin); + wwputc(ctrl(g), cmdwin); error("Type ? for help."); } } @@ -186,7 +187,7 @@ getwin() else if (c >= '1' && c < NWINDOW + '1') w = window[c - '1']; if (w == 0) - wwputc(CTRL(g), cmdwin); + wwputc(ctrl(g), cmdwin); if (!terse) wwputs("\r\n", cmdwin); return w; diff --git a/usr/src/usr.bin/window/cmd1.c b/usr/src/usr.bin/window/cmd1.c index a59b3a56ac..61e92707ca 100644 --- a/usr/src/usr.bin/window/cmd1.c +++ b/usr/src/usr.bin/window/cmd1.c @@ -1,8 +1,9 @@ #ifndef lint -static char *sccsid = "@(#)cmd1.c 3.22 84/03/23"; +static char *sccsid = "@(#)cmd1.c 3.23 84/04/08"; #endif #include "defs.h" +#include "char.h" c_window() { @@ -120,7 +121,7 @@ int maxrow, maxcol; case 'K': *row = minrow; break; - case CTRL([): + case ctrl([): if (!terse) wwputs("\r\nCancelled. ", cmdwin); return 3; @@ -129,7 +130,7 @@ int maxrow, maxcol; default: if (!terse) wwputs("\r\nType [hjklHJKL] to move, return to enter position, escape to cancel.", cmdwin); - wwputc(CTRL(g), cmdwin); + wwputc(ctrl(g), cmdwin); } } return oldrow != *row || oldcol != *col; diff --git a/usr/src/usr.bin/window/cmd2.c b/usr/src/usr.bin/window/cmd2.c index c8709242f4..e3cf1eff4f 100644 --- a/usr/src/usr.bin/window/cmd2.c +++ b/usr/src/usr.bin/window/cmd2.c @@ -1,5 +1,5 @@ #ifndef lint -static char *sccsid = "@(#)cmd2.c 3.26 84/04/07"; +static char *sccsid = "@(#)cmd2.c 3.27 84/04/08"; #endif #include "defs.h" @@ -55,8 +55,8 @@ c_help() error("Can't open help window: %s.", wwerror()); return; } - wwprintf(w, "The escape character is %s, which gets you into command mode.\n\n", - unctrl(escapec)); + wwprintf(w, "The escape character is %c, which gets you into command mode.\n\n", + escapec); if (help_print(w, "Short commands", help_shortcmd) >= 0) (void) help_print(w, "Long commands", help_longcmd); closeiwin(w); diff --git a/usr/src/usr.bin/window/cmd6.c b/usr/src/usr.bin/window/cmd6.c index 970ea0bc0a..77a8c37d49 100644 --- a/usr/src/usr.bin/window/cmd6.c +++ b/usr/src/usr.bin/window/cmd6.c @@ -1,9 +1,10 @@ #ifndef lint -static char *sccsid = "@(#)cmd6.c 3.8 84/03/03"; +static char *sccsid = "@(#)cmd6.c 3.9 84/04/08"; #endif #include "defs.h" #include "string.h" +#include "char.h" /* * Debugging commands. @@ -42,7 +43,7 @@ c_debug() wwdumpwin(w); break; default: - wwputc(CTRL(g), cmdwin); + wwputc(ctrl(g), cmdwin); } } diff --git a/usr/src/usr.bin/window/error.c b/usr/src/usr.bin/window/error.c index 4e27dc68b3..59731b2ada 100644 --- a/usr/src/usr.bin/window/error.c +++ b/usr/src/usr.bin/window/error.c @@ -1,10 +1,11 @@ #ifndef lint -static char *sccsid = "@(#)error.c 3.7 84/03/03"; +static char *sccsid = "@(#)error.c 3.8 84/04/08"; #endif #include "defs.h" #include "value.h" #include "context.h" +#include "char.h" #define ERRLINES 10 /* number of lines for errwin */ @@ -16,7 +17,7 @@ char *fmt; if (cx.x_type != X_FILE) { if (terse) - wwputc(CTRL(g), cmdwin); + wwputc(ctrl(g), cmdwin); else { wwprintf(cmdwin, fmt, a, b, c, d, e, f, g, h); wwputs(" ", cmdwin); diff --git a/usr/src/usr.bin/window/lcmd1.c b/usr/src/usr.bin/window/lcmd1.c index 523199af13..2f34964cb5 100644 --- a/usr/src/usr.bin/window/lcmd1.c +++ b/usr/src/usr.bin/window/lcmd1.c @@ -1,5 +1,5 @@ #ifndef lint -static char *sccsid = "@(#)lcmd1.c 3.20 84/04/06"; +static char *sccsid = "@(#)lcmd1.c 3.21 84/04/08"; #endif #include "defs.h" @@ -91,7 +91,11 @@ struct lcmd_arg arg_escape[] = { l_escape(v, a) register struct value *v, *a; { - if ((v->v_str = str_cpy(unctrl(escapec))) == 0) { + char buf[2]; + + buf[0] = escapec; + buf[1] = 0; + if ((v->v_str = str_cpy(buf)) == 0) { error("Out of memory."); return; } diff --git a/usr/src/usr.bin/window/main.c b/usr/src/usr.bin/window/main.c index c59101e561..8b836ab87d 100644 --- a/usr/src/usr.bin/window/main.c +++ b/usr/src/usr.bin/window/main.c @@ -1,10 +1,11 @@ #ifndef lint -static char *sccsid = "@(#)main.c 3.20 84/04/06"; +static char *sccsid = "@(#)main.c 3.21 84/04/08"; #endif #include "defs.h" #include #include +#include "char.h" #define next(a) (*++*(a) ? *(a) : (*++(a) ? *(a) : (char *)usage())) @@ -60,7 +61,7 @@ char **argv; (void) usage(); } nbufline = 48; /* compatible */ - escapec = CTRL(p); + escapec = ctrl(p); if ((shell = getenv("SHELL")) == 0) shell = "/bin/csh"; if (shellname = rindex(shell, '/')) @@ -89,6 +90,7 @@ char **argv; goto bad; } cmdwin->ww_nointr = 1; + cmdwin->ww_noupdate = 1; if ((framewin = wwopen(WWO_GLASS|WWO_FRAME, wwnrow, wwncol, 0, 0, 0)) == 0) { (void) wwflush(); diff --git a/usr/src/usr.bin/window/startup.c b/usr/src/usr.bin/window/startup.c index 08706b0f72..7b47900abb 100644 --- a/usr/src/usr.bin/window/startup.c +++ b/usr/src/usr.bin/window/startup.c @@ -1,10 +1,11 @@ #ifndef lint -static char *sccsid = "@(#)startup.c 3.9 84/03/03"; +static char *sccsid = "@(#)startup.c 3.10 84/04/08"; #endif #include "defs.h" #include "value.h" #include "var.h" +#include "char.h" doconfig() { @@ -39,14 +40,14 @@ bad: setvars() { - /* try to use a good ordering to balance the tree */ + /* try to use a random ordering to balance the tree */ (void) var_setnum("nrow", wwnrow); (void) var_setnum("ncol", wwncol); - (void) var_setnum("availmodes", wwavailmodes); (void) var_setnum("baud", wwbaud); (void) var_setnum("m_rev", WWM_REV); (void) var_setnum("m_blk", WWM_BLK); (void) var_setnum("m_ul", WWM_UL); (void) var_setnum("m_grp", WWM_GRP); (void) var_setstr("term", wwterm); + (void) var_setnum("modes", wwavailmodes); } diff --git a/usr/src/usr.bin/window/win.c b/usr/src/usr.bin/window/win.c index deb748c651..fc51997d5f 100644 --- a/usr/src/usr.bin/window/win.c +++ b/usr/src/usr.bin/window/win.c @@ -1,8 +1,9 @@ #ifndef lint -static char *sccsid = "@(#)win.c 3.6 84/04/07"; +static char *sccsid = "@(#)win.c 3.7 84/04/08"; #endif #include "defs.h" +#include "char.h" /* * Higher level routines for dealing with windows. @@ -112,6 +113,8 @@ char *label; w->ww_mapnl = 1; w->ww_hasframe = 1; w->ww_nointr = 1; + w->ww_noupdate = 1; + w->ww_unctrl = 1; w->ww_id = -1; w->ww_center = 1; (void) setlabel(w, label); @@ -228,23 +231,30 @@ register struct ww *w; char always; { int c; + char uc = w->ww_unctrl; if (!always && w->ww_cur.r < w->ww_w.b - 2) return 0; c = waitnl1(w, "[Type escape to abort, any other key to continue]"); + w->ww_unctrl = 0; wwputs("\033E", w); - return c == CTRL([) ? 2 : 1; + w->ww_unctrl = uc; + return c == ctrl([) ? 2 : 1; } waitnl1(w, prompt) register struct ww *w; char *prompt; { + char uc = w->ww_unctrl; + + w->ww_unctrl = 0; front(w, 0); wwprintf(w, "\033Y%c%c\033p%s\033q ", w->ww_w.nr - 1 + ' ', ' ', prompt); /* print on last line */ wwcurtowin(w); while (wwpeekc() < 0) wwiomux(); + w->ww_unctrl = uc; return wwgetc(); } diff --git a/usr/src/usr.bin/window/ww.h b/usr/src/usr.bin/window/ww.h index 9b81b69def..6164ee2f6a 100644 --- a/usr/src/usr.bin/window/ww.h +++ b/usr/src/usr.bin/window/ww.h @@ -1,5 +1,5 @@ /* - * @(#)ww.h 3.27 84/03/23 + * @(#)ww.h 3.28 84/04/08 */ #include @@ -23,17 +23,11 @@ struct ww_pos { /* the window structure */ struct ww { + /* information for overlap */ struct ww *ww_forw; /* doubly linked list, for overlapping info */ struct ww *ww_back; - char ww_state; /* state of window creation */ - char ww_wstate; /* state for printing charcters */ - char ww_modes; /* current printing modes */ - char ww_insert :1; /* insert mode, for printing */ - char ww_mapnl :1; /* map \n to \r\n */ - char ww_hascursor :1; /* has fake cursor */ - char ww_hasframe :1; /* frame it */ - char ww_nointr : 1; /* wwwrite() not interruptable */ - char ww_index; /* the index, for wwindex[] */ + char ww_state; /* state of window */ + char ww_index; /* the window index, for wwindex[] */ char ww_order; /* the overlapping order */ /* sizes and positions */ @@ -48,6 +42,17 @@ struct ww { char **ww_fmap; /* map for frame and box windows */ short *ww_nvis; /* how many ww_buf chars are visible per row */ + /* information for wwwrite() and company */ + char ww_wstate; /* state for outputting characters */ + char ww_modes; /* current display modes */ + char ww_insert; /* insert mode */ + char ww_mapnl; /* map \n to \r\n */ + char ww_noupdate; /* don't do updates in wwwrite() */ + char ww_unctrl; /* expand control characters */ + char ww_nointr; /* wwwrite() not interruptable */ + char ww_hascursor; /* has fake cursor */ + char ww_hasframe; /* frame it */ + /* things for the window process and io */ int ww_pty; /* file descriptor of pty */ int ww_pid; /* pid of process, if WWS_HASPROC true */ @@ -60,7 +65,7 @@ struct ww { /* things for the user, they really don't belong here */ char ww_center; /* center the label */ - int ww_id; /* the user window id */ + char ww_id; /* the user window id */ char *ww_label; /* the user supplied label */ struct ww_pos ww_altpos;/* alternate position */ }; @@ -211,10 +216,8 @@ char *wwibq; /* current write position in buffer */ /* our functions */ struct ww *wwopen(); -struct ww *wwfind(); int wwchild(); int wwsuspend(); -char *unctrl(); char **wwalloc(); char *wwerror(); @@ -233,11 +236,6 @@ char *sprintf(); #define MIN(x, y) ((x) > (y) ? (y) : (x)) #define MAX(x, y) ((x) > (y) ? (x) : (y)) -#undef CTRL -#define CTRL(c) ('c'&0x1f) -#define DEL 0x7f -#define ISCTRL(c) ((c) < ' ' & (c) != '\t' || (c) >= DEL) - #if defined(O_4_1A)||defined(O_4_1C) int (*sigset)(); #define signal(s, v) sigset((s), (v)) diff --git a/usr/src/usr.bin/window/wwgets.c b/usr/src/usr.bin/window/wwgets.c index b5b00bef2c..122095caeb 100644 --- a/usr/src/usr.bin/window/wwgets.c +++ b/usr/src/usr.bin/window/wwgets.c @@ -1,8 +1,9 @@ #ifndef lint -static char *sccsid = "@(#)wwgets.c 3.4 84/03/03"; +static char *sccsid = "@(#)wwgets.c 3.5 84/04/08"; #endif #include "ww.h" +#include "char.h" wwgets(buf, n, w) char *buf; @@ -20,7 +21,7 @@ register struct ww *w; if (p > buf) rub(*--p, w); else - wwputc(CTRL(g), w); + wwputc(ctrl(g), w); } else if (c == wwoldtty.ww_sgttyb.sg_kill) { while (p > buf) rub(*--p, w); @@ -34,7 +35,7 @@ register struct ww *w; break; } else { if (p >= buf + n - 1) - wwputc(CTRL(g), w); + wwputc(ctrl(g), w); else wwputs(unctrl(*p++ = c), w); } @@ -49,5 +50,5 @@ struct ww *w; register i; for (i = strlen(unctrl(c)); --i >= 0;) - wwputs("\b \b", w); + wwwrite(w, "\b \b", 3); } diff --git a/usr/src/usr.bin/window/wwinit.c b/usr/src/usr.bin/window/wwinit.c index 83d8b76061..a9b21a4894 100644 --- a/usr/src/usr.bin/window/wwinit.c +++ b/usr/src/usr.bin/window/wwinit.c @@ -1,11 +1,12 @@ #ifndef lint -static char *sccsid = "@(#)wwinit.c 3.16 84/03/23"; +static char *sccsid = "@(#)wwinit.c 3.17 84/04/08"; #endif #include "ww.h" #include "tt.h" #include #include +#include "char.h" wwinit() { diff --git a/usr/src/usr.bin/window/wwlabel.c b/usr/src/usr.bin/window/wwlabel.c index ebbc00bc75..3564ea9852 100644 --- a/usr/src/usr.bin/window/wwlabel.c +++ b/usr/src/usr.bin/window/wwlabel.c @@ -1,8 +1,9 @@ #ifndef lint -static char *sccsid = "@(#)wwlabel.c 3.10 83/12/02"; +static char *sccsid = "@(#)wwlabel.c 3.11 84/04/08"; #endif #include "ww.h" +#include "char.h" /* * Label window w on f, diff --git a/usr/src/usr.bin/window/wwmisc.c b/usr/src/usr.bin/window/wwmisc.c index 465ad57199..0f690edb99 100644 --- a/usr/src/usr.bin/window/wwmisc.c +++ b/usr/src/usr.bin/window/wwmisc.c @@ -1,5 +1,5 @@ #ifndef lint -static char *sccsid = "@(#)wwmisc.c 3.5 83/12/02"; +static char *sccsid = "@(#)wwmisc.c 3.6 84/04/08"; #endif #include "ww.h" @@ -22,28 +22,3 @@ register struct ww *w; nvis++; return nvis == w->ww_i.nr * w->ww_i.nc; } - -char * -unctrl(c) -register c; -{ - static char buf[5]; - register char *p = buf; - - c = (unsigned)(unsigned char)c; - if (c == DEL) { - *p++ = '^'; - *p++ = '?'; - } else if (c < ' ') { - *p++ = '^'; - *p++ = c + '@'; - } else if (c > DEL) { - *p++ = '\\'; - *p++ = (c >> 6 & 3) + '0'; - *p++ = (c >> 3 & 7) + '0'; - *p++ = (c & 7) + '0'; - } else - *p++ = c; - *p = 0; - return buf; -} diff --git a/usr/src/usr.bin/window/wwwrite.c b/usr/src/usr.bin/window/wwwrite.c index d8d8fba169..cf7c4198b4 100644 --- a/usr/src/usr.bin/window/wwwrite.c +++ b/usr/src/usr.bin/window/wwwrite.c @@ -1,10 +1,20 @@ #ifndef lint -static char *sccsid = "@(#)wwwrite.c 3.18 84/03/03"; +static char *sccsid = "@(#)wwwrite.c 3.19 84/04/08"; #endif #include "ww.h" #include "tt.h" +#include "char.h" +/* + * To support control character expansion, we save the old + * p and q values in r and s, and point p at the beginning + * of the expanded string, and q at some safe place beyond it + * (p + 10). At strategic points in the loops, we check + * for (r && !*p) and restore the saved values back into + * p and q. Essentially, we implement a stack of depth 2, + * to avoid recursion, which might be a better idea. + */ wwwrite(w, p, n) register struct ww *w; register char *p; @@ -13,11 +23,20 @@ int n; char hascursor; char *savep = p; char *q = p + n; + char *r = 0; + char *s; if (hascursor = w->ww_hascursor) wwcursor(w, 0); while (p < q && !w->ww_stopped && (!wwinterrupt() || w->ww_nointr)) { - if (w->ww_wstate == 0 && !ISCTRL(*p)) { + if (r && !*p) { + p = r; + q = s; + r = 0; + continue; + } + if (w->ww_wstate == 0 && (isprt(*p) + || w->ww_unctrl && isunctrl(*p))) { register i; register union ww_char *bp; int col, col1; @@ -29,6 +48,12 @@ int n; (w->ww_cur.c - w->ww_w.l & 7); goto chklf; } + if (!isprt(*p)) { + r = p + 1; + s = q; + p = unctrl(*p); + q = p + 10; + } wwinschar(w, w->ww_cur.r, w->ww_cur.c, *p++ | w->ww_modes << WWC_MSHIFT); goto right; @@ -36,23 +61,32 @@ int n; bp = &w->ww_buf[w->ww_cur.r][w->ww_cur.c]; i = w->ww_cur.c; - while (i < w->ww_w.r && p < q && !ISCTRL(*p)) - if (*p == '\t') { + while (i < w->ww_w.r && p < q) + if (!*p && r) { + p = r; + q = s; + r = 0; + } else if (*p == '\t') { register tmp = 8 - (i - w->ww_w.l & 7); p++; i += tmp; bp += tmp; - } else { + } else if (isprt(*p)) { bp++->c_w = *p++ | w->ww_modes << WWC_MSHIFT; i++; - } - + } else if (w->ww_unctrl && isunctrl(*p)) { + r = p + 1; + s = q; + p = unctrl(*p); + q = p + 10; + } else + break; col = MAX(w->ww_cur.c, w->ww_i.l); col1 = MIN(i, w->ww_i.r); w->ww_cur.c = i; - if (w->ww_cur.r >= w->ww_i.t && w->ww_cur.r < w->ww_i.b) - { + if (w->ww_cur.r >= w->ww_i.t + && w->ww_cur.r < w->ww_i.b) { register union ww_char *ns = wwns[w->ww_cur.r]; register char *smap = &wwsmap[w->ww_cur.r][col]; register char *win = w->ww_win[w->ww_cur.r]; @@ -67,7 +101,9 @@ int n; } if (nchanged > 0) { wwtouched[w->ww_cur.r] |= WWU_TOUCHED; - wwupdate1(w->ww_cur.r, w->ww_cur.r + 1); + if (!w->ww_noupdate) + wwupdate1(w->ww_cur.r, + w->ww_cur.r + 1); } } @@ -103,10 +139,10 @@ int n; case '\r': w->ww_cur.c = w->ww_w.l; break; - case CTRL(g): - ttputc(CTRL(g)); + case ctrl(g): + ttputc(ctrl(g)); break; - case CTRL([): + case ctrl([): w->ww_wstate = 1; break; } -- 2.20.1