aboutsummaryrefslogtreecommitdiff
path: root/lua/readline.lua
diff options
context:
space:
mode:
authorMiki Tebeka <miki.tebeka@gmail.com>2015-03-01 06:12:42 +0200
committerMiki Tebeka <miki.tebeka@gmail.com>2015-03-01 06:12:42 +0200
commit9fb199e2cb2cf44cd61c2a226193a70f6013aadc (patch)
tree325a2a8e33e3e8d18217d10854152cab82ac8b61 /lua/readline.lua
parent49916f9402e30a5277146355be878b32ec30f46d (diff)
parent2cb013877c4ed41d245ce7c5525405c4833c503d (diff)
downloadmal-9fb199e2cb2cf44cd61c2a226193a70f6013aadc.tar.gz
mal-9fb199e2cb2cf44cd61c2a226193a70f6013aadc.zip
Merge branch 'master' of https://github.com/kanaka/mal
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")