Builtin: fix word-wrap hack in error window
parent
cbd53c8574
commit
191bb343f9
|
@ -54,6 +54,7 @@ end
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
local sub8 = utf8.sub
|
||||||
local function wordwrap_quickhack(str)
|
local function wordwrap_quickhack(str)
|
||||||
local res = ""
|
local res = ""
|
||||||
local ar = str:split("\n")
|
local ar = str:split("\n")
|
||||||
|
@ -65,8 +66,8 @@ local function wordwrap_quickhack(str)
|
||||||
if res ~= "" then
|
if res ~= "" then
|
||||||
res = res .. ","
|
res = res .. ","
|
||||||
end
|
end
|
||||||
res = res .. core.formspec_escape(text:sub(1, 79))
|
res = res .. core.formspec_escape(sub8(text, 1, 79))
|
||||||
text = text:sub(80, #text)
|
text = sub8(text, 80, #text)
|
||||||
end
|
end
|
||||||
if res ~= "" then
|
if res ~= "" then
|
||||||
res = res .. ","
|
res = res .. ","
|
||||||
|
|
Loading…
Reference in New Issue