int indent, // indent for inside conditionals
int clear_ccline) // clear ccline first
{
+ static int depth = 0; // call depth
int c;
int i;
int j;
int cmdline_type;
int wild_type;
+ // one recursion level deeper
+ ++depth;
+
if (ccline.cmdbuff != NULL)
{
// Being called recursively. Since ccline is global, we need to save
if (init_ccline(firstc, indent) != OK)
goto theend; // out of memory
+ if (depth == 50)
+ {
+ // Somehow got into a loop recursively calling getcmdline(), bail out.
+ emsg(_(e_command_too_recursive));
+ goto theend;
+ }
+
ExpandInit(&xpc);
ccline.xpc = &xpc;
{
char_u *p = ccline.cmdbuff;
+ --depth;
if (did_save_ccline)
restore_cmdline(&save_ccline);
else
call feedkeys(":let a\<C-R>=Check_completion()\<CR>\<Esc>", "xt")
endfunc
+func Test_recursive_register()
+ let @= = ''
+ silent! ?\1ce\12/
+ let caught = 'no'
+ try
+ normal /\12/
+ catch /E169:/
+ let caught = 'yes'
+ endtry
+ call assert_equal('yes', caught)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab