aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/textformat.c
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/textformat.c
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/textformat.c')
-rw-r--r--src/nvim/textformat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/textformat.c b/src/nvim/textformat.c
index ffa273c0ad..b40dbd7bc2 100644
--- a/src/nvim/textformat.c
+++ b/src/nvim/textformat.c
@@ -865,7 +865,7 @@ int fex_format(linenr_T lnum, long count, int c)
// Make a copy, the option could be changed while calling it.
char *fex = xstrdup(curbuf->b_p_fex);
- current_sctx = curbuf->b_p_script_ctx[kBufOptFormatexpr].script_ctx;
+ current_sctx = curbuf->b_p_script_ctx[kBufOptFormatexpr];
// Evaluate the function.
if (use_sandbox) {