diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-03-11 21:09:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-11 21:09:11 +0800 |
commit | 6d0c61d90d316473eee0729363e20bf06825b09b (patch) | |
tree | 0fcae1948517bf620bd4f90f2009a896ebfb637e /src/nvim/api/options.c | |
parent | 8065fc9aaeff734f38109aec52bf852379a5a183 (diff) | |
download | rneovim-6d0c61d90d316473eee0729363e20bf06825b09b.tar.gz rneovim-6d0c61d90d316473eee0729363e20bf06825b09b.tar.bz2 rneovim-6d0c61d90d316473eee0729363e20bf06825b09b.zip |
fix(api): set script context when setting usercmd or option (#22624)
Diffstat (limited to 'src/nvim/api/options.c')
-rw-r--r-- | src/nvim/api/options.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nvim/api/options.c b/src/nvim/api/options.c index ddaed3a254..2d9ffcba06 100644 --- a/src/nvim/api/options.c +++ b/src/nvim/api/options.c @@ -157,7 +157,8 @@ Object nvim_get_option_value(String name, Dict(option) *opts, Error *err) /// - win: |window-ID|. Used for setting window local option. /// - buf: Buffer number. Used for setting buffer local option. /// @param[out] err Error details, if any -void nvim_set_option_value(String name, Object value, Dict(option) *opts, Error *err) +void nvim_set_option_value(uint64_t channel_id, String name, Object value, Dict(option) *opts, + Error *err) FUNC_API_SINCE(9) { int scope = 0; @@ -202,7 +203,9 @@ void nvim_set_option_value(String name, Object value, Dict(option) *opts, Error }); } - access_option_value_for(name.data, &numval, &stringval, scope, opt_type, to, false, err); + WITH_SCRIPT_CONTEXT(channel_id, { + access_option_value_for(name.data, &numval, &stringval, scope, opt_type, to, false, err); + }); } /// Gets the option information for all options. |