mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
api(parse_float_config): use api_object_to_bool()
This commit is contained in:
@@ -1968,24 +1968,15 @@ bool parse_float_config(Dictionary config, FloatConfig *fconfig, bool reconf,
|
|||||||
}
|
}
|
||||||
has_bufpos = true;
|
has_bufpos = true;
|
||||||
} else if (!strcmp(key, "external")) {
|
} else if (!strcmp(key, "external")) {
|
||||||
if (val.type == kObjectTypeInteger) {
|
has_external = fconfig->external
|
||||||
fconfig->external = val.data.integer;
|
= api_object_to_bool(val, "'external' key", false, err);
|
||||||
} else if (val.type == kObjectTypeBoolean) {
|
if (ERROR_SET(err)) {
|
||||||
fconfig->external = val.data.boolean;
|
|
||||||
} else {
|
|
||||||
api_set_error(err, kErrorTypeValidation,
|
|
||||||
"'external' key must be Boolean");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
has_external = fconfig->external;
|
|
||||||
} else if (!strcmp(key, "focusable")) {
|
} else if (!strcmp(key, "focusable")) {
|
||||||
if (val.type == kObjectTypeInteger) {
|
fconfig->focusable
|
||||||
fconfig->focusable = val.data.integer;
|
= api_object_to_bool(val, "'focusable' key", true, err);
|
||||||
} else if (val.type == kObjectTypeBoolean) {
|
if (ERROR_SET(err)) {
|
||||||
fconfig->focusable = val.data.boolean;
|
|
||||||
} else {
|
|
||||||
api_set_error(err, kErrorTypeValidation,
|
|
||||||
"'focusable' key must be Boolean");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (strequal(key, "zindex")) {
|
} else if (strequal(key, "zindex")) {
|
||||||
|
Reference in New Issue
Block a user