aboutsummaryrefslogtreecommitdiff
path: root/lua/readline.lua
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2015-02-28 15:58:35 -0600
committerJoel Martin <github@martintribe.org>2015-02-28 15:58:35 -0600
commit3e0b36dcee99ddfd7ea0e04a382c1ad3858fc45f (patch)
tree523465cf281c01c8930e3166e4050cd201335411 /lua/readline.lua
parent7907cd904a12c542529b27b0517a609e9cc4bb08 (diff)
downloadmal-3e0b36dcee99ddfd7ea0e04a382c1ad3858fc45f.tar.gz
mal-3e0b36dcee99ddfd7ea0e04a382c1ad3858fc45f.zip
Lua: fix with new runtest.py
Diffstat (limited to 'lua/readline.lua')
-rw-r--r--lua/readline.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/lua/readline.lua b/lua/readline.lua
index a75f4ff..5acdb54 100644
--- a/lua/readline.lua
+++ b/lua/readline.lua
@@ -5,6 +5,8 @@ local M = {}
local history_loaded = false
local history_file = os.getenv("HOME") .. "/.mal-history"
+M.raw = false
+
function M.readline(prompt)
if not history_loaded then
history_loaded = true
@@ -13,7 +15,12 @@ function M.readline(prompt)
end
end
- line = LN.linenoise(prompt)
+ if M.raw then
+ io.write(prompt); io.flush();
+ line = io.read()
+ else
+ line = LN.linenoise(prompt)
+ end
if line then
LN.historyadd(line)
local f = io.open(history_file, "a")