2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
5 * %sccs.include.redist.c%
9 static char sccsid
[] = "$Id: ex_undo.c,v 8.1 1993/06/09 22:26:06 bostic Exp $ (Berkeley) $Date: 1993/06/09 22:26:06 $";
12 #include <sys/types.h>
19 * Undo changes to this line, or roll forward.
22 ex_undol(sp
, ep
, cmdp
)
29 if (O_ISSET(sp
, O_NUNDO
)) {
30 if (log_forward(sp
, ep
, &m
))
33 if (log_setline(sp
, ep
, &m
))
40 F_SET(sp
, S_AUTOPRINT
);
47 * Undo the last change.
57 if (O_ISSET(sp
, O_NUNDO
)) {
58 if (log_backward(sp
, ep
, &m
))
61 if (!F_ISSET(ep
, F_UNDO
)) {
68 if (log_forward(sp
, ep
, &m
)) {
75 if (log_backward(sp
, ep
, &m
)) {
79 ep
->lundo
= UBACKWARD
;
86 F_SET(sp
, S_AUTOPRINT
);