summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2016-11-05 19:33:17 -0500
committer cracyc <cracyc@users.noreply.github.com>2016-11-06 13:41:46 -0600
commita6aaa59d19c5183ba16da11ab963646ffbb66aa3 (patch)
tree571edb12468d4b7f2cda7e38a4a3b043ad88a722 /3rdparty
parent68ff36882cc9555dde14bba5f50af8d2d552fbd5 (diff)
lua-linenoise: add preload (nw)
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 },