diff options
author | 2019-03-25 22:44:58 +0100 | |
---|---|---|
committer | 2019-03-25 22:44:58 +0100 | |
commit | c24473ddff715ecec2e258a6eb38960cf8c8e98e (patch) | |
tree | 8ea44b6396a6129913c0aac13859b5de9965e972 /3rdparty/lua-linenoise/linenoise.c | |
parent | 009cba4fb8102102168ef32870892438327f3705 (diff) | |
parent | 598cd5227223c3b04ca31f0dbc1981256d9ea3ff (diff) |
conflict resolution (nw)
Diffstat (limited to '3rdparty/lua-linenoise/linenoise.c')
-rw-r--r-- | 3rdparty/lua-linenoise/linenoise.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/3rdparty/lua-linenoise/linenoise.c b/3rdparty/lua-linenoise/linenoise.c index 768d455729d..aab7c1418ea 100644 --- a/3rdparty/lua-linenoise/linenoise.c +++ b/3rdparty/lua-linenoise/linenoise.c @@ -175,12 +175,26 @@ static int l_refresh(lua_State *L) return handle_ln_ok(L); } +static int l_historyget(lua_State *L) +{ + int len, i; + char **history = linenoiseHistory(&len); + lua_newtable(L); + for(i = 0; i < len; i++) + { + lua_pushstring(L, history[i]); + lua_rawseti(L, -2, i + 1); + } + return 1; +} + luaL_Reg linenoise_funcs[] = { { "linenoise", l_linenoise }, { "historyadd", l_historyadd }, { "historysetmaxlen", l_historysetmaxlen }, { "historysave", l_historysave }, { "historyload", l_historyload }, + { "historyget", l_historyget }, { "clearscreen", l_clearscreen }, { "setcompletion", l_setcompletion}, { "addcompletion", l_addcompletion }, |