diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-10-16 20:41:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-16 20:41:35 +0200 |
commit | a63c67005b9ea17214d86391e2fd649658c1bdec (patch) | |
tree | bd732635435cb15d0d7e0bbe4eb49ceae73c0999 /src/nvim/api/options.c | |
parent | b80a8e2c16b6d6eb16ac84232c27eb7cfa4a434a (diff) | |
parent | 3642f2fb44b6a3681e6a637671690258aa83cc62 (diff) | |
download | rneovim-a63c67005b9ea17214d86391e2fd649658c1bdec.tar.gz rneovim-a63c67005b9ea17214d86391e2fd649658c1bdec.tar.bz2 rneovim-a63c67005b9ea17214d86391e2fd649658c1bdec.zip |
Merge pull request #25394 from famiu/refactor/options/set_option
refactor(options)!: unify interfaces for setting options
Diffstat (limited to 'src/nvim/api/options.c')
-rw-r--r-- | src/nvim/api/options.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/nvim/api/options.c b/src/nvim/api/options.c index 867d1d5e5c..498638d606 100644 --- a/src/nvim/api/options.c +++ b/src/nvim/api/options.c @@ -133,47 +133,6 @@ static buf_T *do_ft_buf(char *filetype, aco_save_T *aco, Error *err) return ftbuf; } -/// Consume an OptVal and convert it to an API Object. -static Object optval_as_object(OptVal o) -{ - switch (o.type) { - case kOptValTypeNil: - return NIL; - case kOptValTypeBoolean: - switch (o.data.boolean) { - case kFalse: - case kTrue: - return BOOLEAN_OBJ(o.data.boolean); - case kNone: - return NIL; - } - UNREACHABLE; - case kOptValTypeNumber: - return INTEGER_OBJ(o.data.number); - case kOptValTypeString: - return STRING_OBJ(o.data.string); - } - UNREACHABLE; -} - -/// Consume an API Object and convert it to an OptVal. -static OptVal object_as_optval(Object o, bool *error) -{ - switch (o.type) { - case kObjectTypeNil: - return NIL_OPTVAL; - case kObjectTypeBoolean: - return BOOLEAN_OPTVAL(o.data.boolean); - case kObjectTypeInteger: - return NUMBER_OPTVAL((OptInt)o.data.integer); - case kObjectTypeString: - return STRING_OPTVAL(o.data.string); - default: - *error = true; - return NIL_OPTVAL; - } -} - /// Gets the value of an option. The behavior of this function matches that of /// |:set|: the local value of an option is returned if it exists; otherwise, /// the global value is returned. Local values always correspond to the current |