feat(lua): add semver api

This commit is contained in:
Kelly Lin
2023-02-19 22:33:57 +11:00
committed by Justin M. Keyes
parent f9a46391ab
commit 0e7196438d
7 changed files with 965 additions and 15 deletions

View File

@@ -165,17 +165,6 @@ static int nlua_pcall(lua_State *lstate, int nargs, int nresults)
return status;
}
/// Gets the version of the current Nvim build.
///
/// @param lstate Lua interpreter state.
static int nlua_nvim_version(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL
{
Dictionary version = version_dict();
nlua_push_Dictionary(lstate, version, true);
api_free_dictionary(version);
return 1;
}
static void nlua_luv_error_event(void **argv)
{
char *error = (char *)argv[0];
@@ -739,10 +728,6 @@ static bool nlua_state_init(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL
// vim.types, vim.type_idx, vim.val_idx
nlua_init_types(lstate);
// neovim version
lua_pushcfunction(lstate, &nlua_nvim_version);
lua_setfield(lstate, -2, "version");
// schedule
lua_pushcfunction(lstate, &nlua_schedule);
lua_setfield(lstate, -2, "schedule");