fix: prefix spaces
This commit is contained in:
@@ -249,7 +249,7 @@ function drawLogs(x0, y0, x1, y1)
|
|||||||
term.setTextColor(format["FG"])
|
term.setTextColor(format["FG"])
|
||||||
|
|
||||||
local prefix = ("[%s]"):format(entry.type)
|
local prefix = ("[%s]"):format(entry.type)
|
||||||
local prefixLength = #prefix
|
local prefixLength = #prefix + 1
|
||||||
local maxMessageWidth = w - prefixLength
|
local maxMessageWidth = w - prefixLength
|
||||||
|
|
||||||
if maxMessageWidth <= 0 then maxMessageWidth = 1 end
|
if maxMessageWidth <= 0 then maxMessageWidth = 1 end
|
||||||
@@ -281,13 +281,15 @@ function drawLogs(x0, y0, x1, y1)
|
|||||||
term.setTextColor(format.FG)
|
term.setTextColor(format.FG)
|
||||||
term.write(prefix)
|
term.write(prefix)
|
||||||
|
|
||||||
|
term.write(" ")
|
||||||
|
|
||||||
term.setBackgroundColor(messageBG)
|
term.setBackgroundColor(messageBG)
|
||||||
term.setTextColor(messageFG)
|
term.setTextColor(messageFG)
|
||||||
term.write(line)
|
term.write(line)
|
||||||
else
|
else
|
||||||
term.setBackgroundColor(messageBG)
|
term.setBackgroundColor(messageBG)
|
||||||
term.setTextColor(messageFG)
|
term.setTextColor(messageFG)
|
||||||
term.write((" "):rep(prefixLength + 1))
|
term.write((" "):rep(prefixLength))
|
||||||
term.write(line)
|
term.write(line)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user