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/options.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/options.c')
-rw-r--r-- | src/nvim/api/options.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/nvim/api/options.c b/src/nvim/api/options.c index 2bbbdbbe8c..64f8a35d54 100644 --- a/src/nvim/api/options.c +++ b/src/nvim/api/options.c @@ -157,8 +157,8 @@ Object nvim_get_option_value(String name, Dict(option) *opts, Error *err) void *from = NULL; char *filetype = NULL; - if (!validate_option_value_args(opts, name.data, &opt_idx, &opt_flags, &scope, &from, &filetype, - err)) { + if (!validate_option_value_args(opts, name.data, &opt_idx, &opt_flags, &scope, &from, + &filetype, err)) { return (Object)OBJECT_INIT; } @@ -182,7 +182,7 @@ Object nvim_get_option_value(String name, Dict(option) *opts, Error *err) from = ftbuf; } - OptVal value = get_option_value_from(opt_idx, option_ctx_from(scope, from), opt_flags); + OptVal value = get_option_value_for(opt_idx, opt_flags, scope, from, err); if (ftbuf != NULL) { // restore curwin/curbuf and a few other things @@ -257,11 +257,7 @@ void nvim_set_option_value(uint64_t channel_id, String name, Object value, Dict( }); 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); }); } |