mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 23:18:33 +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:
@@ -616,11 +616,7 @@ static void func_dump_profile(FILE *fd)
|
||||
}
|
||||
if (fp->uf_script_ctx.sc_sid != 0) {
|
||||
bool should_free;
|
||||
const LastSet last_set = (LastSet){
|
||||
.script_ctx = fp->uf_script_ctx,
|
||||
.channel_id = 0,
|
||||
};
|
||||
char *p = get_scriptname(last_set, &should_free);
|
||||
char *p = get_scriptname(fp->uf_script_ctx, &should_free);
|
||||
fprintf(fd, " Defined: %s:%" PRIdLINENR "\n",
|
||||
p, fp->uf_script_ctx.sc_lnum);
|
||||
if (should_free) {
|
||||
|
Reference in New Issue
Block a user