From 0fefab2cddc49d5070a5a1bd20fba8f6f6c20bbc Mon Sep 17 00:00:00 2001 From: MihailRis Date: Mon, 17 Mar 2025 18:02:12 +0300 Subject: [PATCH] small fixes (#487) * use textbox for editor output --- res/layouts/console.xml | 9 +++++++-- res/layouts/console.xml.lua | 14 +++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/res/layouts/console.xml b/res/layouts/console.xml index bc5fb343..9d015aab 100644 --- a/res/layouts/console.xml +++ b/res/layouts/console.xml @@ -83,8 +83,13 @@ - - + + diff --git a/res/layouts/console.xml.lua b/res/layouts/console.xml.lua index cc9d7147..891fb577 100644 --- a/res/layouts/console.xml.lua +++ b/res/layouts/console.xml.lua @@ -149,9 +149,9 @@ function run_current_file() clear_output() if not chunk then local line, message = err:match(".*:(%d*): (.*)") - document.output:add( + document.output:paste( string.format( - "", + "\n[#FF3030]%s: %s[#FFFFFF]", gui.str("Error at line %{0}"):gsub("%%{0}", line), message) ) return @@ -176,11 +176,7 @@ function run_current_file() } func = funcs[script_type] or func local output = core.capture_output(function() func(unit) end) - document.output:add( - string.format( - "", - output) - ) + document.output:paste(string.format("\n%s", output)) end function save_current_file() @@ -220,8 +216,8 @@ end function clear_output() local output = document.output - output:clear() - output:add("") + output.text = "" + output:paste("[#FFFFFF80]"..gui.str("devtools.output").."[#FFFFFF]") end events.on("core:open_traceback", function(traceback_b64)