aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/stdlib.c
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2023-10-31 09:15:32 -0500
committerGitHub <noreply@github.com>2023-10-31 09:15:32 -0500
commit224f303ee54c54d2147f03010385e8cc48e42869 (patch)
treeb64c86baed2c7d4ea652eee233674188044e2da6 /src/nvim/lua/stdlib.c
parentadbe7f368397da21465f27181e254dd3694820e9 (diff)
downloadrneovim-224f303ee54c54d2147f03010385e8cc48e42869.tar.gz
rneovim-224f303ee54c54d2147f03010385e8cc48e42869.tar.bz2
rneovim-224f303ee54c54d2147f03010385e8cc48e42869.zip
feat(stdlib): add vim.base64 module (#25843)
Add base64 encode() and decode() functions to a vim.base64 module.
Diffstat (limited to 'src/nvim/lua/stdlib.c')
-rw-r--r--src/nvim/lua/stdlib.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/lua/stdlib.c b/src/nvim/lua/stdlib.c
index 14e9902ee2..60be771b6c 100644
--- a/src/nvim/lua/stdlib.c
+++ b/src/nvim/lua/stdlib.c
@@ -26,6 +26,7 @@
#include "nvim/ex_eval.h"
#include "nvim/fold.h"
#include "nvim/globals.h"
+#include "nvim/lua/base64.h"
#include "nvim/lua/converter.h"
#include "nvim/lua/spell.h"
#include "nvim/lua/stdlib.h"
@@ -606,6 +607,10 @@ void nlua_state_add_stdlib(lua_State *const lstate, bool is_thread)
lua_pushcfunction(lstate, &nlua_iconv);
lua_setfield(lstate, -2, "iconv");
+ // vim.base64
+ luaopen_base64(lstate);
+ lua_setfield(lstate, -2, "base64");
+
nlua_state_add_internal(lstate);
}