diff options
author | zeertzjq <zeertzjq@outlook.com> | 2025-01-09 12:32:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-09 12:32:25 +0800 |
commit | 19c9572d3626cde8503ee9061fa334b73f257b03 (patch) | |
tree | 9ac8478d974b5abd3a3a662348a4c7f58cc645db /src/nvim/api/deprecated.c | |
parent | 822313e42b5b8d51ea0b3f1f97c47026f2c7e2e2 (diff) | |
download | rneovim-19c9572d3626cde8503ee9061fa334b73f257b03.tar.gz rneovim-19c9572d3626cde8503ee9061fa334b73f257b03.tar.bz2 rneovim-19c9572d3626cde8503ee9061fa334b73f257b03.zip |
Revert "refactor(options): set option value for non-current context directly" (#31924)
Reverts #31112
Diffstat (limited to 'src/nvim/api/deprecated.c')
-rw-r--r-- | src/nvim/api/deprecated.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/nvim/api/deprecated.c b/src/nvim/api/deprecated.c index 47a49436ab..d5eddb74de 100644 --- a/src/nvim/api/deprecated.c +++ b/src/nvim/api/deprecated.c @@ -649,8 +649,8 @@ static Object get_option_from(void *from, OptScope scope, String name, Error *er OptVal value = NIL_OPTVAL; if (option_has_scope(opt_idx, scope)) { - value = get_option_value_from(opt_idx, option_ctx_from(scope, from), - scope == kOptScopeGlobal ? OPT_GLOBAL : OPT_LOCAL); + value = get_option_value_for(opt_idx, scope == kOptScopeGlobal ? OPT_GLOBAL : OPT_LOCAL, + scope, from, err); if (ERROR_SET(err)) { return (Object)OBJECT_INIT; } @@ -701,11 +701,7 @@ static void set_option_to(uint64_t channel_id, void *to, OptScope scope, String : ((scope == kOptScopeGlobal) ? OPT_GLOBAL : OPT_LOCAL); WITH_SCRIPT_CONTEXT(channel_id, { - const char *errmsg - = set_option_value_for(opt_idx, optval, option_ctx_from(scope, to), opt_flags); - if (errmsg) { - api_set_error(err, kErrorTypeException, "%s", errmsg); - } + set_option_value_for(name.data, opt_idx, optval, opt_flags, scope, to, err); }); } |