add S_RENUMBER support so when a new line is entered all the line
[nvi.git] / ex / ex_stop.c
blobec026bf304c8a7f23fdbd69cb72a0450e01ccf02
1 /*-
2 * Copyright (c) 1993
3 * The Regents of the University of California. All rights reserved.
5 * %sccs.include.redist.c%
6 */
8 #ifndef lint
9 static char sccsid[] = "$Id: ex_stop.c,v 8.4 1993/10/28 11:22:09 bostic Exp $ (Berkeley) $Date: 1993/10/28 11:22:09 $";
10 #endif /* not lint */
12 #include <sys/types.h>
14 #include <errno.h>
15 #include <string.h>
16 #include <unistd.h>
18 #include "vi.h"
19 #include "excmd.h"
20 #include "sex/sex_screen.h"
23 * ex_stop -- :stop[!]
24 * :suspend[!]
25 * Suspend execution.
27 int
28 ex_stop(sp, ep, cmdp)
29 SCR *sp;
30 EXF *ep;
31 EXCMDARG *cmdp;
33 /* For some strange reason, the force flag turns off autowrite. */
34 if (F_ISSET(ep, F_MODIFIED) && O_ISSET(sp, O_AUTOWRITE) &&
35 !F_ISSET(cmdp, E_FORCE)) {
36 if (file_write((sp), (ep), NULL, NULL, NULL, FS_ALL))
37 return (1);
38 if (sex_refresh(sp, ep))
39 return (1);
41 return (sp->s_suspend(sp));