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: v_undo.c,v 8.1 1993/06/09 22:28:33 bostic Exp $ (Berkeley) $Date: 1993/06/09 22:28:33 $";
12 #include <sys/types.h>
23 * Undo changes to this line, or roll forward.
25 * Historic vi moved the cursor to the first non-blank character
26 * of the line when this happened. We do not, since we know where
27 * the cursor actually was when the changes began.
30 v_Undo(sp
, ep
, vp
, fm
, tm
, rp
)
36 if (O_ISSET(sp
, O_NUNDO
))
37 return (log_forward(sp
, ep
, rp
));
38 return (log_setline(sp
, ep
, rp
));
43 * Undo the last change.
46 v_undo(sp
, ep
, vp
, fm
, tm
, rp
)
52 if (O_ISSET(sp
, O_NUNDO
))
53 return (log_backward(sp
, ep
, rp
));
55 if (!F_ISSET(ep
, F_UNDO
)) {
62 if (log_forward(sp
, ep
, rp
)) {
69 if (log_backward(sp
, ep
, rp
)) {
73 ep
->lundo
= UBACKWARD
;