summaryrefslogtreecommitdiffstats
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-05-23 23:34:36 +0200
committerBram Moolenaar <Bram@vim.org>2010-05-23 23:34:36 +0200
commit55debbe38429b81c0ce6e8400aef36812eb151d7 (patch)
tree992320729b697015fb4b99e9f8645cffe2eeddd6 /src/ex_docmd.c
parentc39125d7c45d17566665c06358501073ea9c4141 (diff)
Included patch for persistent undo. Lots of changes and added test.
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index ff39040cf7..4097f1d8f2 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -243,6 +243,10 @@ static void ex_popup __ARGS((exarg_T *eap));
# define ex_spellinfo ex_ni
# define ex_spellrepall ex_ni
#endif
+#ifndef FEAT_PERSISTENT_UNDO
+# define ex_rundo ex_ni
+# define ex_wundo ex_ni
+#endif
#ifndef FEAT_MZSCHEME
# define ex_mzscheme ex_script_ni
# define ex_mzfile ex_ni
@@ -298,6 +302,10 @@ static void ex_join __ARGS((exarg_T *eap));
static void ex_at __ARGS((exarg_T *eap));
static void ex_bang __ARGS((exarg_T *eap));
static void ex_undo __ARGS((exarg_T *eap));
+#ifdef FEAT_PERSISTENT_UNDO
+static void ex_wundo __ARGS((exarg_T *eap));
+static void ex_rundo __ARGS((exarg_T *eap));
+#endif
static void ex_redo __ARGS((exarg_T *eap));
static void ex_later __ARGS((exarg_T *eap));
static void ex_redir __ARGS((exarg_T *eap));
@@ -8452,6 +8460,28 @@ ex_undo(eap)
u_undo(1);
}
+#ifdef FEAT_PERSISTENT_UNDO
+ void
+ex_wundo(eap)
+ exarg_T *eap;
+{
+ char_u hash[UNDO_HASH_SIZE];
+
+ u_compute_hash(hash);
+ u_write_undo(eap->arg, eap->forceit, curbuf, hash);
+}
+
+ void
+ex_rundo(eap)
+ exarg_T *eap;
+{
+ char_u hash[UNDO_HASH_SIZE];
+
+ u_compute_hash(hash);
+ u_read_undo(eap->arg, hash);
+}
+#endif
+
/*
* ":redo".
*/