From 86396789e4052af094ed265de95dfdca27d15ea2 Mon Sep 17 00:00:00 2001 From: Paul Kulchenko Date: Mon, 14 Mar 2016 17:08:25 -0700 Subject: [PATCH] Added `Print` and `Write` method to the console object (#166). --- src/editor/shellbox.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/editor/shellbox.lua b/src/editor/shellbox.lua index 3352a6de0c..f52af4eea5 100644 --- a/src/editor/shellbox.lua +++ b/src/editor/shellbox.lua @@ -211,6 +211,9 @@ DisplayShellPrompt = function (...) out:MarkerAdd(out:GetLineCount()-1, PROMPT_MARKER) end +function out:Print(...) return DisplayShell(...) end +function out:Write(...) return shellPrint(OUTPUT_MARKER, concat("", ...)) end + local function filterTraceError(err, addedret) local err = err:match("(.-:%d+:.-)\n[^\n]*\n[^\n]*\n[^\n]*src/editor/shellbox.lua:.*in function 'executeShellCode'") or err