summaryrefslogtreecommitdiff
path: root/src/eval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-05-30 18:30:36 +0200
committerBram Moolenaar <Bram@vim.org>2010-05-30 18:30:36 +0200
commita17d4c1934b008b9aa8a2d7cf085cfe76a690d9a (patch)
tree0698c081448b50f5c579252f34433da021de4984 /src/eval.c
parent504a82173c607f50801e90f8001bb2f1c13fecf9 (diff)
downloadvim-git-a17d4c1934b008b9aa8a2d7cf085cfe76a690d9a.tar.gz
Added the undofile() function. Updated runtime files.
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c
index 06615ae90..865dc3a7d 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -731,6 +731,7 @@ static void f_tr __ARGS((typval_T *argvars, typval_T *rettv));
static void f_trunc __ARGS((typval_T *argvars, typval_T *rettv));
#endif
static void f_type __ARGS((typval_T *argvars, typval_T *rettv));
+static void f_undofile __ARGS((typval_T *argvars, typval_T *rettv));
static void f_values __ARGS((typval_T *argvars, typval_T *rettv));
static void f_virtcol __ARGS((typval_T *argvars, typval_T *rettv));
static void f_visualmode __ARGS((typval_T *argvars, typval_T *rettv));
@@ -7825,6 +7826,7 @@ static struct fst
{"trunc", 1, 1, f_trunc},
#endif
{"type", 1, 1, f_type},
+ {"undofile", 1, 1, f_undofile},
{"values", 1, 1, f_values},
{"virtcol", 1, 1, f_virtcol},
{"visualmode", 0, 1, f_visualmode},
@@ -17584,6 +17586,23 @@ f_type(argvars, rettv)
}
/*
+ * "undofile(name)" function
+ */
+ static void
+f_undofile(argvars, rettv)
+ typval_T *argvars;
+ typval_T *rettv;
+{
+ rettv->v_type = VAR_STRING;
+#ifdef FEAT_PERSISTENT_UNDO
+ rettv->vval.v_string = u_get_undo_file_name(get_tv_string(&argvars[0]),
+ FALSE);
+#else
+ rettv->vval.v_string = NULL;
+#endif
+}
+
+/*
* "values(dict)" function
*/
static void