aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/deprecated.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/api/deprecated.c')
-rw-r--r--src/nvim/api/deprecated.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/nvim/api/deprecated.c b/src/nvim/api/deprecated.c
index d5eddb74de..47a49436ab 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_for(opt_idx, scope == kOptScopeGlobal ? OPT_GLOBAL : OPT_LOCAL,
- scope, from, err);
+ value = get_option_value_from(opt_idx, option_ctx_from(scope, from),
+ scope == kOptScopeGlobal ? OPT_GLOBAL : OPT_LOCAL);
if (ERROR_SET(err)) {
return (Object)OBJECT_INIT;
}
@@ -701,7 +701,11 @@ 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, {
- set_option_value_for(name.data, opt_idx, optval, opt_flags, scope, to, err);
+ 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);
+ }
});
}