summaryrefslogtreecommitdiffstatshomepage
path: root/plugins/console/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/console/init.lua')
-rw-r--r--plugins/console/init.lua20
1 files changed, 5 insertions, 15 deletions
diff --git a/plugins/console/init.lua b/plugins/console/init.lua
index 1b40ac50bee..3e10e17bc14 100644
--- a/plugins/console/init.lua
+++ b/plugins/console/init.lua
@@ -23,16 +23,6 @@ function console.startplugin()
local matches = {}
local lastindex = 0
local consolebuf
- _G.history = function (index)
- local history = ln.historyget()
- if index then
- ln.preload(history[index])
- return
- end
- for num, line in ipairs(history) do
- print(num, line)
- end
- end
print(" /| /| /| /| /| _______")
print(" / | / | / | / | / | / /")
print(" / |/ | / | / |/ | / ____/ ")
@@ -51,11 +41,11 @@ function console.startplugin()
ln.historysetmaxlen(50)
local scr = [[
local ln = require('linenoise')
- ln.setcompletion(function(c, str, pos)
- status = str .. "\x01" .. tostring(pos)
+ ln.setcompletion(
+ function(c, str)
yield()
- ln.addcompletion(c, status:match("([^\x01]*)\x01(.*)"))
- end)
+ ln.addcompletion(c, str)
+ end)
local ret = ln.linenoise('$PROMPT')
if ret == nil then
return "\n"
@@ -256,7 +246,7 @@ function console.startplugin()
lastindex = lastindex + 1
print(consolebuf[lastindex])
end
- ln.refresh()
+ -- ln.refresh() FIXME: how to replicate this now that the API has been removed?
end
if conth.yield then
conth:continue(get_completions(conth.result:match("([^\x01]*)\x01(.*)")))