aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-12-22 10:33:34 +0800
committerGitHub <noreply@github.com>2023-12-22 10:33:34 +0800
commit6700127b30d55e6ddf70495e7b886464172d7ac6 (patch)
treeb3019d2d9e8661be8f18dc9c92ebf1f23bbf4150 /src
parent2b3d1e18545ab9d2853f802c6d5adf54b5bf189c (diff)
downloadrneovim-6700127b30d55e6ddf70495e7b886464172d7ac6.tar.gz
rneovim-6700127b30d55e6ddf70495e7b886464172d7ac6.tar.bz2
rneovim-6700127b30d55e6ddf70495e7b886464172d7ac6.zip
vim-patch:9.0.2183: Maximum callback depth is not configurable (#26703)
Problem: Maximum callback depth is not configurable. Solution: Revert patch 9.0.2103. Set 'maxfuncdepth' in test. fixes: vim/vim#13732 closes: vim/vim#13736 https://github.com/vim/vim/commit/fe583b1e5987fbfdb5f2141c133dbff9665ed301
Diffstat (limited to 'src')
-rw-r--r--src/nvim/eval.c4
-rw-r--r--src/nvim/options.lua1
2 files changed, 2 insertions, 3 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 68347fd582..3818944fc9 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -89,8 +89,6 @@
#define DICT_MAXNEST 100 // maximum nesting of lists and dicts
-#define MAX_CALLBACK_DEPTH 20
-
static const char *e_missbrac = N_("E111: Missing ']'");
static const char *e_list_end = N_("E697: Missing end of List ']': %s");
static const char e_cannot_slice_dictionary[]
@@ -6061,7 +6059,7 @@ bool callback_call(Callback *const callback, const int argcount_in, typval_T *co
typval_T *const rettv)
FUNC_ATTR_NONNULL_ALL
{
- if (callback_depth > MAX_CALLBACK_DEPTH) {
+ if (callback_depth > p_mfd) {
emsg(_(e_command_too_recursive));
return false;
}
diff --git a/src/nvim/options.lua b/src/nvim/options.lua
index cb25d481ec..43c938b0bf 100644
--- a/src/nvim/options.lua
+++ b/src/nvim/options.lua
@@ -5158,6 +5158,7 @@ return {
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.
]=],
full_name = 'maxfuncdepth',
scope = { 'global' },