mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 09:26:30 +00:00
fix(api): don't override Vimscript SID (#32610)
Problem: When calling an API from Vimscript to set an option, mapping, etc., :verbose shows that it's set from an API client. Solution: Don't override current_sctx.sc_sid when calling an API from Vimscript. Also fix the inverse case where API channel id is not set when calling an API from RPC. Move channel id into sctx_T to make saving and restoring easier. Related #8329
This commit is contained in:
@@ -298,9 +298,7 @@ EXTERN bool garbage_collect_at_exit INIT( = false);
|
||||
#define SID_STR (-10) // for sourcing a string with no script item
|
||||
|
||||
// Script CTX being sourced or was sourced to define the current function.
|
||||
EXTERN sctx_T current_sctx INIT( = { 0, 0, 0 });
|
||||
// ID of the current channel making a client API call
|
||||
EXTERN uint64_t current_channel_id INIT( = 0);
|
||||
EXTERN sctx_T current_sctx INIT( = { 0, 0, 0, 0 });
|
||||
/// Last channel that invoked 'nvim_input` or got FocusGained.
|
||||
EXTERN uint64_t current_ui INIT( = 0);
|
||||
|
||||
|
Reference in New Issue
Block a user