aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-02-25 09:17:51 +0800
committerGitHub <noreply@github.com>2025-02-25 01:17:51 +0000
commit095c0876c2010d6160df37cf057f2d0ad2c4501f (patch)
treea1ad1fbecda4626835bb415a3d4ee80f56c4362a /src/nvim/eval
parent614c9322d50052c76fb3e6e1be7536a972ff0902 (diff)
downloadrneovim-095c0876c2010d6160df37cf057f2d0ad2c4501f.tar.gz
rneovim-095c0876c2010d6160df37cf057f2d0ad2c4501f.tar.bz2
rneovim-095c0876c2010d6160df37cf057f2d0ad2c4501f.zip
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
Diffstat (limited to 'src/nvim/eval')
-rw-r--r--src/nvim/eval/typval_defs.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/nvim/eval/typval_defs.h b/src/nvim/eval/typval_defs.h
index 90b0d4e4a9..ddc2b154a4 100644
--- a/src/nvim/eval/typval_defs.h
+++ b/src/nvim/eval/typval_defs.h
@@ -286,14 +286,9 @@ typedef struct {
scid_T sc_sid; ///< script ID
int sc_seq; ///< sourcing sequence number
linenr_T sc_lnum; ///< line number
+ uint64_t sc_chan; ///< Only used when sc_sid is SID_API_CLIENT.
} sctx_T;
-/// Stores an identifier of a script or channel that last set an option.
-typedef struct {
- sctx_T script_ctx; /// script context where the option was last set
- uint64_t channel_id; /// Only used when script_id is SID_API_CLIENT.
-} LastSet;
-
enum { MAX_FUNC_ARGS = 20, }; ///< Maximum number of function arguments
enum { VAR_SHORT_LEN = 20, }; ///< Short variable name length
enum { FIXVAR_CNT = 12, }; ///< Number of fixed variables used for arguments