diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-04-25 22:19:04 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-04-25 22:19:04 -0700 |
commit | 8fb1885348c97b6577ec51be2e838b8679e7064f (patch) | |
tree | 9d2ccedc8cd95d2ce23eff84ddd4942db14ba0ca /mu.lua | |
parent | dfd67aed3c8d2f587a4902e8e1a101d96a01948a (diff) | |
download | lines.love-8fb1885348c97b6577ec51be2e838b8679e7064f.tar.gz |
stop mixing ncurses with print
Diffstat (limited to 'mu.lua')
-rw-r--r-- | mu.lua | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/mu.lua b/mu.lua index e0342fb..8091eca 100644 --- a/mu.lua +++ b/mu.lua @@ -37,12 +37,16 @@ while true do new_expr = true local success, results = gather_results(xpcall(f, function(...) return debug.traceback() end)) if success then - for _, result in ipairs(results) do - print(result) + for i, result in ipairs(results) do + if i > 1 then + stdscr:addch('\t') + end + stdscr:addstr(tostring(result)) end else - print(results[1]) + stdscr:addstr(tostring(result[1])) end + stdscr:addch('\n') else local f, err = load(buf, 'REPL') if f then @@ -51,11 +55,15 @@ while true do local success, results = gather_results(xpcall(f, function(...) return debug.traceback() end)) if success then for _, result in ipairs(results) do - print(result) + if i > 1 then + stdscr:addch('\t') + end + stdscr:addstr(tostring(result)) end else - print(results[1]) + stdscr:addstr(tostring(result[1])) end + stdscr:addch('\n') else stdscr:addstr(err..'\n') if string.match(err, "'<eof>'$") or string.match(err, "<eof>$") then |