Added the undofile() function. Updated runtime files.
diff --git a/src/eval.c b/src/eval.c
index 06615ae..865dc3a 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -731,6 +731,7 @@
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 @@
{"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 @@
}
/*
+ * "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