BSD 4 release
[unix-history] / usr / src / cmd / ex / ex_v.c
index c42808b..be06ec5 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_v.c      6.1 10/18/80";
 #include "ex.h"
 #include "ex_re.h"
 #include "ex_tty.h"
 #include "ex.h"
 #include "ex_re.h"
 #include "ex_tty.h"
@@ -53,7 +54,7 @@ oop()
 {
        register char *ic;
        char atube[TUBESIZE + LBSIZE];
 {
        register char *ic;
        char atube[TUBESIZE + LBSIZE];
-       register int f;
+       register ttymode f;
 
        ovbeg();
        if (peekchar() == '/') {
 
        ovbeg();
        if (peekchar() == '/') {
@@ -128,7 +129,7 @@ ovbeg()
 }
 
 ovend(f)
 }
 
 ovend(f)
-       int f;
+       ttymode f;
 {
 
        splitw++;
 {
 
        splitw++;
@@ -153,7 +154,7 @@ vop()
 {
        register int c;
        char atube[TUBESIZE + LBSIZE];
 {
        register int c;
        char atube[TUBESIZE + LBSIZE];
-       register int f;
+       register ttymode f;
 
        if (!CA && UP == NOSTR) {
                if (initev) {
 
        if (!CA && UP == NOSTR) {
                if (initev) {
@@ -175,6 +176,11 @@ toopen:
                        goto toopen;
                error("Visual requires clear screen capability");
        }
                        goto toopen;
                error("Visual requires clear screen capability");
        }
+       if (NS && !SF) {
+               if (initev)
+                       goto toopen;
+               error("Visual requires scrolling");
+       }
        ovbeg();
        bastate = VISUAL;
        c = 0;
        ovbeg();
        bastate = VISUAL;
        c = 0;
@@ -258,6 +264,8 @@ undvis()
        undap1 = one;
        undap2 = dol + 1;
        undkind = UNDALL;
        undap1 = one;
        undap2 = dol + 1;
        undkind = UNDALL;
+       if (undadot <= zero || undadot > dol)
+               undadot = zero+1;
 }
 
 /*
 }
 
 /*
@@ -318,11 +326,11 @@ vok(atube)
        vtube0 = atube;
        vclrbyte(atube, WCOLS * (WECHO - ZERO + 1));
        for (i = 0; i < ZERO; i++)
        vtube0 = atube;
        vclrbyte(atube, WCOLS * (WECHO - ZERO + 1));
        for (i = 0; i < ZERO; i++)
-               vtube[i] = (char *) -20000;
+               vtube[i] = (char *) 0;
        for (; i <= WECHO; i++)
                vtube[i] = atube, atube += WCOLS;
        for (; i < TUBELINES; i++)
        for (; i <= WECHO; i++)
                vtube[i] = atube, atube += WCOLS;
        for (; i < TUBELINES; i++)
-               vtube[i] = (char *) -20000;
+               vtube[i] = (char *) 0;
        vutmp = atube;
        vundkind = VNONE;
        vUNDdot = 0;
        vutmp = atube;
        vundkind = VNONE;
        vUNDdot = 0;