mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 23:18:33 +00:00
eval: Add eval_call_provider/eval_has_provider functions
These use autoloaded vimscript to replace the provider_call/provider_has functions, moving the implementation of providers to pure vimscript(we lose nothing since vimscript can also call msgpack-rpc functions). When calling the rpcrequest function from a provider, temporarily switch to the caller scope. This is required for compatibility with legacy plugins, because they may depend on scope information that changes when "leaving" the C stack to enter the vimscript stack.
This commit is contained in:
@@ -360,6 +360,16 @@ EXTERN int garbage_collect_at_exit INIT(= FALSE);
|
||||
|
||||
/* ID of script being sourced or was sourced to define the current function. */
|
||||
EXTERN scid_T current_SID INIT(= 0);
|
||||
// Scope information for the code that indirectly triggered the current
|
||||
// provider function call
|
||||
EXTERN struct caller_scope {
|
||||
scid_T SID;
|
||||
uint8_t *sourcing_name, *autocmd_fname, *autocmd_match;
|
||||
linenr_T sourcing_lnum;
|
||||
int autocmd_fname_full, autocmd_bufnr;
|
||||
void *funccalp;
|
||||
} provider_caller_scope;
|
||||
EXTERN int provider_call_nesting INIT(= 0);
|
||||
|
||||
/* Magic number used for hashitem "hi_key" value indicating a deleted item.
|
||||
* Only the address is used. */
|
||||
|
Reference in New Issue
Block a user