mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 19:36:40 +00:00
luahl: global the luahl
This commit is contained in:
@@ -1618,3 +1618,15 @@ free_exit:
|
||||
clear_virttext(&virt_text);
|
||||
return virt_text;
|
||||
}
|
||||
|
||||
bool api_is_truthy(Object obj, const char *what, Error *err)
|
||||
{
|
||||
if (obj.type == kObjectTypeBoolean) {
|
||||
return obj.data.boolean;
|
||||
} else if (obj.type == kObjectTypeInteger) {
|
||||
return obj.data.integer; // C semantics: non-zery int is true
|
||||
} else {
|
||||
api_set_error(err, kErrorTypeValidation, "%s is not an boolean", what);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user