aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/executor.c
diff options
context:
space:
mode:
authorMichael Lingelbach <m.j.lbach@gmail.com>2021-09-26 12:23:46 -0700
committerGitHub <noreply@github.com>2021-09-26 12:23:46 -0700
commit68c65b7732efdb637c4a0d1e2f2799932f654c59 (patch)
treeb790c771d539e429a968861b672aa906f80dd483 /src/nvim/lua/executor.c
parent3246bf5f4e24025b4a14ed99eeb4a8f954626519 (diff)
parent9c31f3b026ca2612bdda7e41fa0da3b2e29bba18 (diff)
downloadrneovim-68c65b7732efdb637c4a0d1e2f2799932f654c59.tar.gz
rneovim-68c65b7732efdb637c4a0d1e2f2799932f654c59.tar.bz2
rneovim-68c65b7732efdb637c4a0d1e2f2799932f654c59.zip
Merge pull request #14871 from mjlbach/feature/lua-cjson-embedded
feat(lua): expose lua-cjson as vim.json
Diffstat (limited to 'src/nvim/lua/executor.c')
-rw-r--r--src/nvim/lua/executor.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c
index 8c7dc90111..9333d781cd 100644
--- a/src/nvim/lua/executor.c
+++ b/src/nvim/lua/executor.c
@@ -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");
{