Merge #22214 move init_default_autocmds to lua

This commit is contained in:
Justin M. Keyes
2023-02-14 19:13:12 -05:00
committed by GitHub
5 changed files with 26 additions and 36 deletions

View File

@@ -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);