mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 16:28:17 +00:00
vim-patch:8.1.2047: cannot check the current state
Problem: Cannot check the current state.
Solution: Add the state() function.
0e57dd859e
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -5994,6 +5994,13 @@ bool callback_from_typval(Callback *const callback, const typval_T *const arg)
|
||||
return true;
|
||||
}
|
||||
|
||||
static int callback_depth = 0;
|
||||
|
||||
int get_callback_depth(void)
|
||||
{
|
||||
return callback_depth;
|
||||
}
|
||||
|
||||
/// @return whether the callback could be called.
|
||||
bool callback_call(Callback *const callback, const int argcount_in, typval_T *const argvars_in,
|
||||
typval_T *const rettv)
|
||||
@@ -6041,7 +6048,11 @@ bool callback_call(Callback *const callback, const int argcount_in, typval_T *co
|
||||
funcexe.fe_lastline = curwin->w_cursor.lnum;
|
||||
funcexe.fe_evaluate = true;
|
||||
funcexe.fe_partial = partial;
|
||||
return call_func(name, -1, rettv, argcount_in, argvars_in, &funcexe);
|
||||
|
||||
callback_depth++;
|
||||
int ret = call_func(name, -1, rettv, argcount_in, argvars_in, &funcexe);
|
||||
callback_depth--;
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool set_ref_in_callback(Callback *callback, int copyID, ht_stack_T **ht_stack,
|
||||
|
Reference in New Issue
Block a user