diff options
author | TJ DeVries <devries.timothyj@gmail.com> | 2021-05-28 15:45:34 -0400 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2022-02-28 19:53:50 +0100 |
commit | 0f613482b389ad259dd53d893907b024a115352e (patch) | |
tree | 0f0e998db32c33139809bce38b18e6ae54639165 /src/nvim/api/private/helpers.h | |
parent | 6732cd9e57bf39d1a0f5c4fa08fa54c1561f2d2f (diff) | |
download | rneovim-0f613482b389ad259dd53d893907b024a115352e.tar.gz rneovim-0f613482b389ad259dd53d893907b024a115352e.tar.bz2 rneovim-0f613482b389ad259dd53d893907b024a115352e.zip |
feat(lua): add missing changes to autocmds lost in the rebase
Note: some of these changes are breaking, like change of API signatures
Diffstat (limited to 'src/nvim/api/private/helpers.h')
-rw-r--r-- | src/nvim/api/private/helpers.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h index 6969994c3b..bc7c2e6a60 100644 --- a/src/nvim/api/private/helpers.h +++ b/src/nvim/api/private/helpers.h @@ -152,13 +152,15 @@ typedef struct { #endif #define WITH_SCRIPT_CONTEXT(channel_id, code) \ - const sctx_T save_current_sctx = current_sctx; \ - 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_sctx = save_current_sctx; + do { \ + const sctx_T save_current_sctx = current_sctx; \ + 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_sctx = save_current_sctx; \ + } while (0); #endif // NVIM_API_PRIVATE_HELPERS_H |