summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--runtime/doc/message.txt4
-rw-r--r--runtime/doc/options.txt1
-rw-r--r--src/userfunc.c5
-rw-r--r--src/version.c2
4 files changed, 9 insertions, 3 deletions
diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt
index 240f2c4326..f8a9fdfa60 100644
--- a/runtime/doc/message.txt
+++ b/runtime/doc/message.txt
@@ -1,4 +1,4 @@
-*message.txt* For Vim version 9.0. Last change: 2023 May 24
+*message.txt* For Vim version 9.0. Last change: 2023 Nov 08
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -135,6 +135,8 @@ This happens when an Ex command executes an Ex command that executes an Ex
command, etc. The limit is 200 or the value of 'maxfuncdepth', whatever is
larger. When it's more there probably is an endless loop. Probably a
|:execute| or |:source| command is involved.
+Can also happen with a recursive callback function (|job-callback|).
+A limit of 20 is used here.
*E254*
Cannot allocate color {name} ~
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 76efc5d416..77efbd63f2 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -5486,7 +5486,6 @@ A jump table for the options with a short description can be found at |Q_op|.
Increasing this limit above 200 also changes the maximum for Ex
command recursion, see |E169|.
See also |:function|.
- Also used for maximum depth of callback functions.
*'maxmapdepth'* *'mmd'* *E223*
'maxmapdepth' 'mmd' number (default 1000)
diff --git a/src/userfunc.c b/src/userfunc.c
index 5ef0f7d9c9..33e73a9a52 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -14,6 +14,9 @@
#include "vim.h"
#if defined(FEAT_EVAL) || defined(PROTO)
+
+#define MAX_CALLBACK_DEPTH 20
+
/*
* All user-defined functions are found in this hashtable.
*/
@@ -3584,7 +3587,7 @@ call_callback(
if (callback->cb_name == NULL || *callback->cb_name == NUL)
return FAIL;
- if (callback_depth > p_mfd)
+ if (callback_depth > MAX_CALLBACK_DEPTH)
{
emsg(_(e_command_too_recursive));
return FAIL;
diff --git a/src/version.c b/src/version.c
index 238e3df101..8afbc403d2 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2103,
+/**/
2102,
/**/
2101,