Attempt to allow empty lines in telex/files.

These were previously filtered out. Unfortunately now there's some
awkward emtpy lines in various places, but, I prefer having empty
lines show since that makes typing much simpler.
This commit is contained in:
Auke Kok 2019-10-04 22:15:06 -07:00
parent 27448a62ea
commit 3099dd6228

View File

@ -76,9 +76,11 @@ local function make_formspec(output, prompt)
"textlist[0.4,0.5;11,6;output;"
local c = 1
for part in output:gmatch("[^\r\n]+") do
f = f .. minetest.formspec_escape(part) .. ","
c = c + 1
if output then
for part in output:gmatch("([^\r\n]*)\n?") do
f = f .. minetest.formspec_escape(part) .. ","
c = c + 1
end
end
f = f .. minetest.formspec_escape(prompt) .. ";" .. c .. ";false]"
@ -565,7 +567,7 @@ local terminal_use = function(pos, node, clicker, itemstack, pointed_thing)
end
-- send formspec to player
fsc.show(name,
make_formspec("", "> "),
make_formspec(nil, "> "),
context,
term.recv)
minetest.sound_play("terminal_power_on", {pos = pos})