0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.1.2047: cannot check the current state

Problem:    Cannot check the current state.
Solution:   Add the state() function.
This commit is contained in:
Bram Moolenaar
2019-09-16 22:56:03 +02:00
parent 69198cb8c0
commit 0e57dd859e
12 changed files with 230 additions and 111 deletions

View File

@@ -1447,6 +1447,14 @@ func_call(
return r;
}
static int callback_depth = 0;
int
get_callback_depth(void)
{
return callback_depth;
}
/*
* Invoke call_func() with a callback.
*/
@@ -1460,12 +1468,15 @@ call_callback(
// PLUS ONE elements!
{
funcexe_T funcexe;
int ret;
vim_memset(&funcexe, 0, sizeof(funcexe));
funcexe.evaluate = TRUE;
funcexe.partial = callback->cb_partial;
return call_func(callback->cb_name, len, rettv, argcount, argvars,
&funcexe);
++callback_depth;
ret = call_func(callback->cb_name, len, rettv, argcount, argvars, &funcexe);
--callback_depth;
return ret;
}
/*