aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/api/private/helpers.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h
index ec97ba9ec6..b70452d7cb 100644
--- a/src/nvim/api/private/helpers.h
+++ b/src/nvim/api/private/helpers.h
@@ -175,11 +175,13 @@ typedef struct {
#define WITH_SCRIPT_CONTEXT(channel_id, code) \
do { \
const sctx_T save_current_sctx = current_sctx; \
+ const uint64_t save_channel_id = current_channel_id; \
current_sctx.sc_sid = \
(channel_id) == LUA_INTERNAL_CALL ? SID_LUA : SID_API_CLIENT; \
current_sctx.sc_lnum = 0; \
current_channel_id = channel_id; \
code; \
+ current_channel_id = save_channel_id; \
current_sctx = save_current_sctx; \
} while (0);