summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ex_docmd.c12
-rw-r--r--src/globals.h3
-rw-r--r--src/version.c2
3 files changed, 17 insertions, 0 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index cd915c9da..591775f4c 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -8058,6 +8058,16 @@ alist_set(
int fnum_len)
{
int i;
+ static int recursive = 0;
+
+ if (recursive)
+ {
+#ifdef FEAT_AUTOCMD
+ EMSG(_(e_au_recursive));
+#endif
+ return;
+ }
+ ++recursive;
alist_clear(al);
if (ga_grow(&al->al_ga, count) == OK)
@@ -8087,6 +8097,8 @@ alist_set(
FreeWild(count, files);
if (al == &global_alist)
arg_had_last = FALSE;
+
+ --recursive;
}
/*
diff --git a/src/globals.h b/src/globals.h
index 737812cdd..943bb3130 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -1594,6 +1594,9 @@ EXTERN char_u e_notset[] INIT(= N_("E764: Option '%s' is not set"));
EXTERN char_u e_invalidreg[] INIT(= N_("E850: Invalid register name"));
#endif
EXTERN char_u e_dirnotf[] INIT(= N_("E919: Directory not found in '%s': \"%s\""));
+#ifdef FEAT_AUTOCMD
+EXTERN char_u e_au_recursive[] INIT(= N_("E952: Autocommand caused recursive behavior"));
+#endif
#ifdef FEAT_GUI_MAC
EXTERN short disallow_gui INIT(= FALSE);
diff --git a/src/version.c b/src/version.c
index f56ef3577..963f611fa 100644
--- a/src/version.c
+++ b/src/version.c
@@ -772,6 +772,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1485,
+/**/
1484,
/**/
1483,