summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2016-11-06 18:57:19 -0600
committer GitHub <noreply@github.com>2016-11-06 18:57:19 -0600
commit846dfa8ffd11babca234da90ab6bbb646c703be4 (patch)
treee85b8dd5e791c327bb13b66dd5e718d61001885b /3rdparty
parent196c841dcbda9ba93c00f6f4a5fc419eac6b0bfa (diff)
parentcbf588359ee1fdb60cea32f653112144f35ca62d (diff)
Merge pull request #1642 from cracyc/luaconsole
Make console a Lua plugin
Diffstat (limited to '3rdparty')
-rw-r--r--3rdparty/lua-linenoise/linenoise.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/3rdparty/lua-linenoise/linenoise.c b/3rdparty/lua-linenoise/linenoise.c
index 670a71c2b22..fc8ae19e079 100644
--- a/3rdparty/lua-linenoise/linenoise.c
+++ b/3rdparty/lua-linenoise/linenoise.c
@@ -101,6 +101,14 @@ static int l_historyadd(lua_State *L)
return handle_ln_ok(L);
}
+static int l_preloadbuffer(lua_State *L)
+{
+ const char *line = luaL_checkstring(L, 1);
+ linenoisePreloadBuffer(line);
+
+ return handle_ln_ok(L);
+}
+
static int l_historysetmaxlen(lua_State *L)
{
int len = luaL_checkinteger(L, 1);
@@ -168,6 +176,7 @@ luaL_Reg linenoise_funcs[] = {
{ "clearscreen", l_clearscreen },
{ "setcompletion", l_setcompletion},
{ "addcompletion", l_addcompletion },
+ { "preload", l_preloadbuffer },
/* Aliases for more consistent function names */
{ "addhistory", l_historyadd },