summaryrefslogtreecommitdiff
path: root/usr.bin/vi/cl
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/vi/cl')
-rw-r--r--usr.bin/vi/cl/cl.h29
-rw-r--r--usr.bin/vi/cl/cl_screen.c9
-rw-r--r--usr.bin/vi/cl/cl_term.c9
3 files changed, 20 insertions, 27 deletions
diff --git a/usr.bin/vi/cl/cl.h b/usr.bin/vi/cl/cl.h
index e711e95161f..d69108911e8 100644
--- a/usr.bin/vi/cl/cl.h
+++ b/usr.bin/vi/cl/cl.h
@@ -6,7 +6,7 @@
*
* See the LICENSE file for redistribution information.
*
- * @(#)cl.h 10.17 (Berkeley) 7/12/96
+ * @(#)cl.h 10.18 (Berkeley) 9/15/96
*/
typedef struct _cl_private {
@@ -24,8 +24,6 @@ typedef struct _cl_private {
char *rmso, *smso; /* Inverse video terminal strings. */
char *smcup, *rmcup; /* Terminal start/stop strings. */
- int in_ex; /* XXX: Currently running ex. */
-
int killersig; /* Killer signal. */
#define INDX_HUP 0
#define INDX_INT 1
@@ -40,14 +38,15 @@ typedef struct _cl_private {
enum { /* Terminal initialization strings. */
TE_SENT=0, TI_SENT } ti_te;
-#define CL_RENAME 0x001 /* X11 xterm icon/window renamed. */
-#define CL_RENAME_OK 0x002 /* User wants the windows renamed. */
-#define CL_SCR_EX_INIT 0x004 /* Ex screen initialized. */
-#define CL_SCR_VI_INIT 0x008 /* Vi screen initialized. */
-#define CL_SIGHUP 0x010 /* SIGHUP arrived. */
-#define CL_SIGINT 0x020 /* SIGINT arrived. */
-#define CL_SIGTERM 0x040 /* SIGTERM arrived. */
-#define CL_SIGWINCH 0x080 /* SIGWINCH arrived. */
+#define CL_IN_EX 0x0001 /* Currently running ex. */
+#define CL_RENAME 0x0002 /* X11 xterm icon/window renamed. */
+#define CL_RENAME_OK 0x0004 /* User wants the windows renamed. */
+#define CL_SCR_EX_INIT 0x0008 /* Ex screen initialized. */
+#define CL_SCR_VI_INIT 0x0010 /* Vi screen initialized. */
+#define CL_SIGHUP 0x0020 /* SIGHUP arrived. */
+#define CL_SIGINT 0x0040 /* SIGINT arrived. */
+#define CL_SIGTERM 0x0080 /* SIGTERM arrived. */
+#define CL_SIGWINCH 0x0100 /* SIGWINCH arrived. */
u_int32_t flags;
} CL_PRIVATE;
@@ -60,14 +59,6 @@ typedef enum { INP_OK=0, INP_EOF, INP_ERR, INP_INTR, INP_TIMEOUT } input_t;
/* The screen line relative to a specific window. */
#define RLNO(sp, lno) (sp)->woff + (lno)
-/* Some functions can be safely ignored until the screen is running. */
-#define VI_INIT_IGNORE(sp) \
- if (F_ISSET(sp, SC_VI) && !F_ISSET(sp, SC_SCR_VI)) \
- return (0);
-#define EX_INIT_IGNORE(sp) \
- if (F_ISSET(sp, SC_EX) && !F_ISSET(sp, SC_SCR_EX)) \
- return (0);
-
/* X11 xterm escape sequence to rename the icon/window. */
#define XTERM_RENAME "\033]0;%s\007"
diff --git a/usr.bin/vi/cl/cl_screen.c b/usr.bin/vi/cl/cl_screen.c
index 1efc0fa61ac..9d8d9811a21 100644
--- a/usr.bin/vi/cl/cl_screen.c
+++ b/usr.bin/vi/cl/cl_screen.c
@@ -10,7 +10,7 @@
#include "config.h"
#ifndef lint
-static const char sccsid[] = "@(#)cl_screen.c 10.47 (Berkeley) 7/30/96";
+static const char sccsid[] = "@(#)cl_screen.c 10.48 (Berkeley) 9/15/96";
#endif /* not lint */
#include <sys/types.h>
@@ -102,8 +102,7 @@ cl_screen(sp, flags)
if (LF_ISSET(SC_EX)) {
if (cl_ex_init(sp))
return (1);
- clp->in_ex = 1;
- F_SET(clp, CL_SCR_EX_INIT);
+ F_SET(clp, CL_IN_EX | CL_SCR_EX_INIT);
/*
* If doing an ex screen for ex mode, move to the last line
@@ -115,7 +114,7 @@ cl_screen(sp, flags)
} else {
if (cl_vi_init(sp))
return (1);
- clp->in_ex = 0;
+ F_CLR(clp, CL_IN_EX);
F_SET(clp, CL_SCR_VI_INIT);
}
return (0);
@@ -398,7 +397,7 @@ cl_vi_end(gp)
* Move to the bottom of the window (some endwin implementations don't
* do this for you).
*/
- if (!clp->in_ex) {
+ if (!F_ISSET(clp, CL_IN_EX)) {
(void)move(0, 0);
(void)deleteln();
(void)move(LINES - 1, 0);
diff --git a/usr.bin/vi/cl/cl_term.c b/usr.bin/vi/cl/cl_term.c
index 0e34628c597..e4007403870 100644
--- a/usr.bin/vi/cl/cl_term.c
+++ b/usr.bin/vi/cl/cl_term.c
@@ -10,7 +10,7 @@
#include "config.h"
#ifndef lint
-static const char sccsid[] = "@(#)cl_term.c 10.21 (Berkeley) 7/12/96";
+static const char sccsid[] = "@(#)cl_term.c 10.22 (Berkeley) 9/15/96";
#endif /* not lint */
#include <sys/types.h>
@@ -183,8 +183,11 @@ cl_fmap(sp, stype, from, flen, to, tlen)
CHAR_T *from, *to;
size_t flen, tlen;
{
- EX_INIT_IGNORE(sp);
- VI_INIT_IGNORE(sp);
+ /* Ignore until the screen is running, do the real work then. */
+ if (F_ISSET(sp, SC_VI) && !F_ISSET(sp, SC_SCR_VI))
+ return (0);
+ if (F_ISSET(sp, SC_EX) && !F_ISSET(sp, SC_SCR_EX))
+ return (0);
return (cl_pfmap(sp, stype, from, flen, to, tlen));
}