aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/options.c
diff options
context:
space:
mode:
authorFamiu Haque <famiuhaque@proton.me>2023-09-27 23:30:17 +0600
committerFamiu Haque <famiuhaque@proton.me>2023-10-17 00:08:47 +0600
commit93b9c889465ee6a55e71c1fd681c1c6b1d5ed060 (patch)
treeb1cf69e4b844c5c67b005a980d0d09a8a67e15c3 /src/nvim/api/options.c
parent0892c1cd94672e0dffe3b97fc4a85ea517b05598 (diff)
downloadrneovim-93b9c889465ee6a55e71c1fd681c1c6b1d5ed060.tar.gz
rneovim-93b9c889465ee6a55e71c1fd681c1c6b1d5ed060.tar.bz2
rneovim-93b9c889465ee6a55e71c1fd681c1c6b1d5ed060.zip
refactor(options): unify set_num_option and set_bool_option
Diffstat (limited to 'src/nvim/api/options.c')
-rw-r--r--src/nvim/api/options.c41
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