aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_nested_function.vim
diff options
context:
space:
mode:
authorKunMing Xie <qqzz014@gmail.com>2017-08-07 05:03:08 +0800
committerJustin M. Keyes <justinkz@gmail.com>2017-08-06 23:03:08 +0200
commitd1f0b5aa5d594f3041c3fc6c026ff720c07beaeb (patch)
tree2b09090c79dd56aad21ea6a74bfea135dc668c3a /src/nvim/testdir/test_nested_function.vim
parent36ceb9397c7fc383356e54ea8eab8fa3d6cefb1f (diff)
downloadrneovim-d1f0b5aa5d594f3041c3fc6c026ff720c07beaeb.tar.gz
rneovim-d1f0b5aa5d594f3041c3fc6c026ff720c07beaeb.tar.bz2
rneovim-d1f0b5aa5d594f3041c3fc6c026ff720c07beaeb.zip
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'. https://github.com/vim/vim/commit/777b30f827bcbe10a40640b1bf0361cb93a16be1
Diffstat (limited to 'src/nvim/testdir/test_nested_function.vim')
-rw-r--r--src/nvim/testdir/test_nested_function.vim21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_nested_function.vim b/src/nvim/testdir/test_nested_function.vim
index 7e301ed33e..afaaea6ceb 100644
--- a/src/nvim/testdir/test_nested_function.vim
+++ b/src/nvim/testdir/test_nested_function.vim
@@ -40,3 +40,24 @@ func Test_nested_argument()
delfunc g:X
unlet g:Y
endfunc
+
+func Recurse(count)
+ if a:count > 0
+ call Recurse(a:count - 1)
+ endif
+endfunc
+
+func Test_max_nesting()
+ let call_depth_here = 2
+ let ex_depth_here = 5
+ set mfd&
+
+ call Recurse(99 - call_depth_here)
+ call assert_fails('call Recurse(' . (100 - call_depth_here) . ')', 'E132:')
+
+ set mfd=210
+ call Recurse(209 - ex_depth_here)
+ call assert_fails('call Recurse(' . (210 - ex_depth_here) . ')', 'E169:')
+
+ set mfd&
+endfunc