diff --git a/ex.h b/ex.h index 275d8b0..0d5cdb2 100644 --- a/ex.h +++ b/ex.h @@ -72,7 +72,7 @@ * * from ex.h 7.7.1.1 (Berkeley) 8/12/86 * - * Sccsid @(#)ex.h 1.56 (gritter) 8/6/05 + * Sccsid @(#)ex.h 1.57 (gritter) 8/6/05 */ /* @@ -526,7 +526,7 @@ var line *undadot; /* If we saved all lines, dot reverts here */ #define UNDPUT 4 extern int (*Outchar)(int); -extern void (*Pline)(int, int); +extern int (*Pline)(int, int); extern int (*Putchar)(int); #define NOSTR (char *) 0 diff --git a/ex_proto.h b/ex_proto.h index 853e3c8..81e0190 100644 --- a/ex_proto.h +++ b/ex_proto.h @@ -71,7 +71,7 @@ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * Sccsid @(#)ex_proto.h 1.32 (gritter) 8/6/05 + * Sccsid @(#)ex_proto.h 1.33 (gritter) 8/6/05 */ /* @@ -192,12 +192,12 @@ extern int widthok(int c); extern int GETWC(char *); /* ex_put.c */ extern int (*setlist(int))(int); -extern void (*setnumb(int))(int, int); +extern int (*setnumb(int))(int, int); extern int listchar(int); extern int normchar(register int); extern void slobber(int); -extern void numbline(int, int); -extern void normline(int, int); +extern int numbline(int, int); +extern int normline(int, int); extern int putchar(int); extern int termchar(int); extern void flush2(void); diff --git a/ex_put.c b/ex_put.c index 5395783..d008249 100644 --- a/ex_put.c +++ b/ex_put.c @@ -73,7 +73,7 @@ #ifndef lint #ifdef DOSCCS -static char sccsid[] = "@(#)ex_put.c 1.33 (gritter) 8/6/05"; +static char sccsid[] = "@(#)ex_put.c 1.34 (gritter) 8/6/05"; #endif #endif @@ -101,7 +101,7 @@ static char sccsid[] = "@(#)ex_put.c 1.33 (gritter) 8/6/05"; */ int (*Outchar)(int) = termchar; int (*Putchar)(int) = normchar; -void (*Pline)(int, int) = normline; +int (*Pline)(int, int) = normline; int (* setlist(int t))(int) @@ -114,10 +114,10 @@ setlist(int t))(int) return (P); } -void (* +int (* setnumb(int t))(int, int) { - register void (*P)(int, int); + register int (*P)(int, int); numberf = t; P = Pline; @@ -272,21 +272,20 @@ slobber(int c) /* * Print a line with a number. */ -void +int numbline(int i, int max) { if (shudclob) slobber(' '); max -= printf("%6d ", i); - normline(0, max); + return normline(0, max); } /* * Normal line output, no numbering. */ -/*ARGSUSED*/ -void +int normline(int unused, int max) { extern short vcntcol, lastsc; @@ -294,6 +293,7 @@ normline(int unused, int max) register char *cp; int (*OO)(int); int c, n; + int ret = 0; if (max > 0) vcntcol = 0; @@ -321,6 +321,7 @@ normline(int unused, int max) putchar('@'); vcntcol = ovc + 1; lastsc = 1; + ret = 1; break; } ovc = vcntcol; @@ -332,6 +333,7 @@ normline(int unused, int max) if (!inopen) { putchar('\n' | QUOTE); } + return ret; } /* diff --git a/ex_vadj.c b/ex_vadj.c index d23f588..c579ee7 100644 --- a/ex_vadj.c +++ b/ex_vadj.c @@ -73,7 +73,7 @@ #ifndef lint #ifdef DOSCCS -static char sccsid[] = "@(#)ex_vadj.c 1.15 (gritter) 8/6/05"; +static char sccsid[] = "@(#)ex_vadj.c 1.16 (gritter) 8/6/05"; #endif #endif @@ -192,7 +192,8 @@ vreopen(int p, int lineno, int l) * necessary to determine which way to go. */ vigoto(p, 0); - pline(lineno, WCOLS*WLINES); + if (pline(lineno, WCOLS*WLINES) == 1) + vp->vflags |= VLONG; /* * When we are typing part of a line for hardcopy open, don't diff --git a/ex_version.c b/ex_version.c index 83c373b..82dfa6c 100644 --- a/ex_version.c +++ b/ex_version.c @@ -70,7 +70,7 @@ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * Sccsid @(#)ex_version.c 1.142 (gritter) 8/6/05 + * Sccsid @(#)ex_version.c 1.143 (gritter) 8/6/05 */ #include "ex.h" @@ -91,7 +91,7 @@ printver(void) /* SLIST */ /* ex.c:static char sccsid[] = "@(#)ex.c 1.37 (gritter) 8/4/05"; -ex.h: * Sccsid @(#)ex.h 1.56 (gritter) 8/6/05 +ex.h: * Sccsid @(#)ex.h 1.57 (gritter) 8/6/05 ex_addr.c:static char sccsid[] = "@(#)ex_addr.c 1.11 (gritter) 8/4/05"; ex_argv.h: * Sccsid @(#)ex_argv.h 1.9 (gritter) 8/4/05 ex_cmds.c:static char sccsid[] = "@(#)ex_cmds.c 1.22 (gritter) 2/18/05"; @@ -101,8 +101,8 @@ ex_data.c:static char sccsid[] = "@(#)ex_data.c 1.14 (gritter) 11/23/04"; ex_extern.c:static char sccsid[] = "@(#)ex_extern.c 1.6 (gritter) 11/23/04"; ex_get.c:static char sccsid[] = "@(#)ex_get.c 1.18 (gritter) 8/4/05"; ex_io.c:static char sccsid[] = "@(#)ex_io.c 1.42 (gritter) 8/4/05"; -ex_proto.h: * Sccsid @(#)ex_proto.h 1.32 (gritter) 8/6/05 -ex_put.c:static char sccsid[] = "@(#)ex_put.c 1.33 (gritter) 8/6/05"; +ex_proto.h: * Sccsid @(#)ex_proto.h 1.33 (gritter) 8/6/05 +ex_put.c:static char sccsid[] = "@(#)ex_put.c 1.34 (gritter) 8/6/05"; ex_re.c:static char sccsid[] = "@(#)ex_re.c 1.60 (gritter) 8/6/05"; ex_re.h: * Sccsid @(#)ex_re.h 1.24 (gritter) 8/4/05 ex_set.c:static char sccsid[] = "@(#)ex_set.c 1.11 (gritter) 11/24/04"; @@ -115,11 +115,11 @@ ex_tty.h: * Sccsid @(#)ex_tty.h 1.14 (gritter) 8/4/05 ex_tune.h: * Sccsid @(#)ex_tune.h 1.14 (gritter) 8/4/05 ex_unix.c:static char sccsid[] = "@(#)ex_unix.c 1.17 (gritter) 8/4/05"; ex_v.c:static char sccsid[] = "@(#)ex_v.c 1.19 (gritter) 8/4/05"; -ex_vadj.c:static char sccsid[] = "@(#)ex_vadj.c 1.15 (gritter) 8/6/05"; -ex_vget.c:static char sccsid[] = "@(#)ex_vget.c 1.30 (gritter) 8/6/05"; -ex_vis.h: * Sccsid @(#)ex_vis.h 1.21 (gritter) 8/4/05 -ex_vmain.c:static char sccsid[] = "@(#)ex_vmain.c 1.32 (gritter) 8/6/05"; -ex_voper.c:static char sccsid[] = "@(#)ex_voper.c 1.27 (gritter) 2/15/05"; +ex_vadj.c:static char sccsid[] = "@(#)ex_vadj.c 1.16 (gritter) 8/6/05"; +ex_vget.c:static char sccsid[] = "@(#)ex_vget.c 1.31 (gritter) 8/6/05"; +ex_vis.h: * Sccsid @(#)ex_vis.h 1.22 (gritter) 8/6/05 +ex_vmain.c:static char sccsid[] = "@(#)ex_vmain.c 1.33 (gritter) 8/6/05"; +ex_voper.c:static char sccsid[] = "@(#)ex_voper.c 1.28 (gritter) 8/6/05"; ex_vops.c:static char sccsid[] = "@(#)ex_vops.c 1.28 (gritter) 8/4/05"; ex_vops2.c:static char sccsid[] = "@(#)ex_vops2.c 1.35 (gritter) 8/4/05"; ex_vops3.c:static char sccsid[] = "@(#)ex_vops3.c 1.21 (gritter) 8/4/05"; diff --git a/ex_vget.c b/ex_vget.c index 46cb55a..868c843 100644 --- a/ex_vget.c +++ b/ex_vget.c @@ -73,7 +73,7 @@ #ifndef lint #ifdef DOSCCS -static char sccsid[] = "@(#)ex_vget.c 1.30 (gritter) 8/6/05"; +static char sccsid[] = "@(#)ex_vget.c 1.31 (gritter) 8/6/05"; #endif #endif @@ -406,7 +406,7 @@ int readecho(int c) { register char *sc = cursor; - register void (*OP)(int, int); + register int (*OP)(int, int); bool waste; register int OPeek; diff --git a/ex_vis.h b/ex_vis.h index ebdb9cb..cc79433 100644 --- a/ex_vis.h +++ b/ex_vis.h @@ -72,7 +72,7 @@ * * from ex_vis.h 7.4 (Berkeley) 5/31/85 * - * Sccsid @(#)ex_vis.h 1.21 (gritter) 8/4/05 + * Sccsid @(#)ex_vis.h 1.22 (gritter) 8/6/05 */ /* @@ -154,6 +154,7 @@ var struct vlinfo *vlinfo; #define FLAGS(c) (vlinfo[c].vflags) #define VDIRT 1 +#define VLONG 2 /* Line does not fit on a single screen */ /* * Hacks to copy vlinfo structures around diff --git a/ex_vmain.c b/ex_vmain.c index 10e611c..3c1f941 100644 --- a/ex_vmain.c +++ b/ex_vmain.c @@ -73,7 +73,7 @@ #ifndef lint #ifdef DOSCCS -static char sccsid[] = "@(#)ex_vmain.c 1.32 (gritter) 8/6/05"; +static char sccsid[] = "@(#)ex_vmain.c 1.33 (gritter) 8/6/05"; #endif #endif @@ -104,7 +104,7 @@ vmain(void) int ind, nlput; int shouldpo = 0; int onumber = 0, olist = 0; - void (*OPline)(int, int) = NULL; + int (*OPline)(int, int) = NULL; int (*OPutchar)(int) = NULL; CLOBBGRD(c); diff --git a/ex_voper.c b/ex_voper.c index d86b5d9..5cb693e 100644 --- a/ex_voper.c +++ b/ex_voper.c @@ -73,7 +73,7 @@ #ifndef lint #ifdef DOSCCS -static char sccsid[] = "@(#)ex_voper.c 1.27 (gritter) 2/15/05"; +static char sccsid[] = "@(#)ex_voper.c 1.28 (gritter) 8/6/05"; #endif #endif @@ -715,6 +715,7 @@ errlab: wcursor = 0; if (readecho(c)) return; +lloop: if (!vglobp) vscandir[0] = genbuf[0]; oglobp = globp; @@ -790,6 +791,12 @@ slerr: if (state == CRTOPEN && addr != dot) vup1(); vupdown(addr - dot, NOSTR); + if (FLAGS(vcline)&VLONG && + addr == odot && + cursor == ocurs) { + cursor = NULL; + goto lloop; + } } return; }