mirror of
https://github.com/neovim/neovim.git
synced 2025-09-17 08:48:16 +00:00
vim-patch:8.0.0137 (#7119)
Problem: When 'maxfuncdepth' is set above 200 the nesting is limited to
200. (Brett Stahlman)
Solution: Allow for Ex command recursion depending on 'maxfuncdepth'.
777b30f827
This commit is contained in:

committed by
Justin M. Keyes

parent
36ceb9397c
commit
d1f0b5aa5d
@@ -340,12 +340,13 @@ int do_cmdline(char_u *cmdline, LineGetter fgetline,
|
||||
msg_list = &private_msg_list;
|
||||
private_msg_list = NULL;
|
||||
|
||||
/* It's possible to create an endless loop with ":execute", catch that
|
||||
* here. The value of 200 allows nested function calls, ":source", etc. */
|
||||
if (call_depth == 200) {
|
||||
// It's possible to create an endless loop with ":execute", catch that
|
||||
// here. The value of 200 allows nested function calls, ":source", etc.
|
||||
// Allow 200 or 'maxfuncdepth', whatever is larger.
|
||||
if (call_depth >= 200 && call_depth >= p_mfd) {
|
||||
EMSG(_("E169: Command too recursive"));
|
||||
/* When converting to an exception, we do not include the command name
|
||||
* since this is not an error of the specific command. */
|
||||
// When converting to an exception, we do not include the command name
|
||||
// since this is not an error of the specific command.
|
||||
do_errthrow((struct condstack *)NULL, (char_u *)NULL);
|
||||
msg_list = saved_msg_list;
|
||||
return FAIL;
|
||||
|
Reference in New Issue
Block a user