summaryrefslogtreecommitdiff
path: root/usr.bin/mg/file.c
diff options
context:
space:
mode:
authorKjell Wooding <kjell@cvs.openbsd.org>2008-09-15 16:13:36 +0000
committerKjell Wooding <kjell@cvs.openbsd.org>2008-09-15 16:13:36 +0000
commit46afcbd52cae880b9a7eb20df81241e1f99a64cb (patch)
treee7f8293c9d96e318bdccb005f328c5824f50f1d8 /usr.bin/mg/file.c
parent0b98546c7b94e0858d8daad1b96091ba91734f4b (diff)
Expose the undo commands as proper mg functions.
This should have no functional change on undo, but it does facilitate testing undo behavior.
Diffstat (limited to 'usr.bin/mg/file.c')
-rw-r--r--usr.bin/mg/file.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/mg/file.c b/usr.bin/mg/file.c
index 6f3f87f7d78..9c5aac36b9b 100644
--- a/usr.bin/mg/file.c
+++ b/usr.bin/mg/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.68 2008/09/15 16:11:35 kjell Exp $ */
+/* $OpenBSD: file.c,v 1.69 2008/09/15 16:13:35 kjell Exp $ */
/* This file is in the public domain. */
@@ -293,7 +293,7 @@ insertfile(char *fname, char *newname, int replacebuf)
char *dp;
if (replacebuf == TRUE)
- x = undo_enable(FALSE);
+ x = undo_enable(FFRAND, 0);
else
x = undo_enabled();
@@ -335,7 +335,7 @@ insertfile(char *fname, char *newname, int replacebuf)
killbuffer(bp);
if ((bp = dired_(fname)) == NULL)
return (FALSE);
- undo_enable(x);
+ undo_enable(FFRAND, x);
curbp = bp;
return (showbuffer(bp, curwp, WFFULL | WFMODE));
} else {
@@ -351,10 +351,10 @@ insertfile(char *fname, char *newname, int replacebuf)
* We will delete this newline after insertion.
* Disable undo, as we create the undo record manually.
*/
- x2 = undo_enable(FALSE);
+ x2 = undo_enable(FFRAND, 0);
(void)lnewline();
olp = lback(curwp->w_dotp);
- undo_enable(x2);
+ undo_enable(FFRAND, x2);
nline = 0;
siz = 0;
@@ -477,7 +477,7 @@ out: lp2 = NULL;
}
bp->b_lines += nline;
cleanup:
- undo_enable(x);
+ undo_enable(FFRAND, x);
/* return FALSE if error */
return (s != FIOERR);