mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 22:18:33 +00:00
Merge pull request #14871 from mjlbach/feature/lua-cjson-embedded
feat(lua): expose lua-cjson as vim.json
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#include "nvim/undo.h"
|
||||
#include "nvim/version.h"
|
||||
#include "nvim/vim.h"
|
||||
#include "cjson/lua_cjson.h"
|
||||
|
||||
static int in_fast_callback = 0;
|
||||
|
||||
@@ -531,6 +532,9 @@ static int nlua_state_init(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL
|
||||
lua_pushcfunction(lstate, &nlua_xdl_diff);
|
||||
lua_setfield(lstate, -2, "diff");
|
||||
|
||||
lua_cjson_new(lstate);
|
||||
lua_setfield(lstate, -2, "json");
|
||||
|
||||
lua_setglobal(lstate, "vim");
|
||||
|
||||
{
|
||||
|
Reference in New Issue
Block a user