aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ex_docmd.c9
-rw-r--r--src/nvim/globals.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index ad51de46ee..cec5431bbd 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -6536,6 +6536,13 @@ void alist_expand(int *fnum_list, int fnum_len)
void alist_set(alist_T *al, int count, char_u **files, int use_curbuf, int *fnum_list, int fnum_len)
{
int i;
+ static int recursive = 0;
+
+ if (recursive) {
+ EMSG(_(e_au_recursive));
+ return;
+ }
+ recursive++;
alist_clear(al);
ga_grow(&al->al_ga, count);
@@ -6562,6 +6569,8 @@ void alist_set(alist_T *al, int count, char_u **files, int use_curbuf, int *fnum
if (al == &global_alist)
arg_had_last = FALSE;
+
+ recursive--;
}
/*
diff --git a/src/nvim/globals.h b/src/nvim/globals.h
index 9bba2379cd..5606747ce9 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -1099,6 +1099,8 @@ EXTERN char_u e_notset[] INIT(= N_("E764: Option '%s' is not set"));
EXTERN char_u e_invalidreg[] INIT(= N_("E850: Invalid register name"));
EXTERN char_u e_dirnotf[] INIT(= N_(
"E919: Directory not found in '%s': \"%s\""));
+EXTERN char_u e_au_recursive[] INIT(= N_(
+ "E952: Autocommand caused recursive behavior"));
EXTERN char_u e_unsupportedoption[] INIT(= N_("E519: Option not supported"));
EXTERN char_u e_fnametoolong[] INIT(= N_("E856: Filename too long"));
EXTERN char_u e_float_as_string[] INIT(= N_("E806: using Float as a String"));