Fix terminal destroying context.

After a draft or edit, the terminal always left the context in an
invalid state. I finally found this terrible bug that's been making
the terminal difficult to work with... `button_exit` can _not_ be
used if the context is to be preserved. Of course we also forgot to
properly store the output for the context.
This commit is contained in:
Auke Kok 2019-08-07 21:31:16 -07:00
parent 2065b0b55b
commit a1f484a2f2

View File

@ -145,7 +145,7 @@ term.commands = {
fsc.show(c.name, "size[12,8]" ..
"textarea[0.5,0.5;11.5,7.0;text;text;" ..
minetest.formspec_escape(text) .. "]" ..
"button_exit[5.2,7.2;1.6,0.5;exit;Save]",
"button[5.2,7.2;1.6,0.5;exit;Save]",
c,
term.edit)
@ -256,7 +256,7 @@ term.commands = {
minetest.formspec_escape(subject) .. "]" ..
"textarea[0.5,1.5;11.5,7.0;text;text;" ..
minetest.formspec_escape(text) .. "]" ..
"button_exit[5.2,7.7;1.6,0.5;exit;Save]",
"button[5.2,7.7;1.6,0.5;exit;Save]",
c,
term.draft)
@ -482,6 +482,8 @@ function term.edit(player, fields, context)
output = output .. "\n" .. "Error: no space left on device\n"
end
c.output = output
fsc.show(name,
make_formspec(output, "> "),
c,
@ -513,6 +515,8 @@ function term.draft(player, fields, context)
output = output .. "\n" .. "Error: no space left on device\n"
end
c.output = output
fsc.show(name,
make_formspec(output, "> "),
c,