bug, wrong value to getcount for 'z' command
[nvi.git] / vi / v_screen.c
blob1ded1138bc84275a5b03e92f2c798be1d7798d99
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: v_screen.c,v 8.8 1993/11/28 18:31:30 bostic Exp $ (Berkeley) $Date: 1993/11/28 18:31:30 $";
10 #endif /* not lint */
12 #include <sys/types.h>
14 #include "vi.h"
15 #include "vcmd.h"
18 * v_screen --
19 * Switch screens.
21 int
22 v_screen(sp, ep, vp, fm, tm, rp)
23 SCR *sp;
24 EXF *ep;
25 VICMDARG *vp;
26 MARK *fm, *tm, *rp;
29 * Try for the next lower screen, or, go back to the first
30 * screen on the stack.
32 if (sp->q.cqe_next != (void *)&sp->gp->dq)
33 sp->nextdisp = sp->q.cqe_next;
34 else if (sp->gp->dq.cqh_first == sp) {
35 msgq(sp, M_ERR, "No other screen to switch to.");
36 return (1);
37 } else
38 sp->nextdisp = sp->gp->dq.cqh_first;
41 * Display the old screen's status line so the user can
42 * find the screen they want.
44 (void)status(sp, ep, fm->lno, 0);
46 /* Save the old screen's cursor information. */
47 sp->frp->lno = sp->lno;
48 sp->frp->cno = sp->cno;
49 F_SET(sp->frp, FR_CURSORSET);
51 F_SET(sp, S_SSWITCH);
52 return (0);