mirror of
https://github.com/rxi/lovebird.git
synced 2024-11-15 22:54:21 +00:00
Added special CSS formatting for lovebird errors
This commit is contained in:
parent
f9205bf2cd
commit
3c0db4f4e3
25
lovebird.lua
25
lovebird.lua
@ -73,6 +73,18 @@ end
|
|||||||
border-radius: 7px;
|
border-radius: 7px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
.errormarker {
|
||||||
|
color: #F0F0F0;
|
||||||
|
background: #8E0000;
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 8px;
|
||||||
|
width: 17px;
|
||||||
|
padding-top: 0px;
|
||||||
|
padding-bottom: 0px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
.greybordered {
|
.greybordered {
|
||||||
margin: 12px;
|
margin: 12px;
|
||||||
background: #F0F0F0;
|
background: #F0F0F0;
|
||||||
@ -88,6 +100,9 @@ end
|
|||||||
content: '\00B7\00B7\00B7';
|
content: '\00B7\00B7\00B7';
|
||||||
padding-right: 5px;
|
padding-right: 5px;
|
||||||
}
|
}
|
||||||
|
.errorline {
|
||||||
|
color: #8E0000;
|
||||||
|
}
|
||||||
#header {
|
#header {
|
||||||
background: #101010;
|
background: #101010;
|
||||||
height: 25px;
|
height: 25px;
|
||||||
@ -388,6 +403,7 @@ function lovebird.init()
|
|||||||
lovebird.addr, lovebird.port = lovebird.server:getsockname()
|
lovebird.addr, lovebird.port = lovebird.server:getsockname()
|
||||||
lovebird.server:settimeout(0)
|
lovebird.server:settimeout(0)
|
||||||
-- Wrap print
|
-- Wrap print
|
||||||
|
lovebird.origprint = print
|
||||||
if lovebird.wrapprint then
|
if lovebird.wrapprint then
|
||||||
local oldprint = print
|
local oldprint = print
|
||||||
print = function(...)
|
print = function(...)
|
||||||
@ -511,6 +527,10 @@ function lovebird.recalcbuffer()
|
|||||||
if line.type == "input" then
|
if line.type == "input" then
|
||||||
str = '<span class="inputline">' .. str .. '</span>'
|
str = '<span class="inputline">' .. str .. '</span>'
|
||||||
else
|
else
|
||||||
|
if line.type == "error" then
|
||||||
|
str = '<span class="errormarker">!</span> ' .. str
|
||||||
|
str = '<span class="errorline">' .. str .. '</span>'
|
||||||
|
end
|
||||||
if line.count > 1 then
|
if line.count > 1 then
|
||||||
str = '<span class="repeatcount">' .. line.count .. '</span> ' .. str
|
str = '<span class="repeatcount">' .. line.count .. '</span> ' .. str
|
||||||
end
|
end
|
||||||
@ -545,7 +565,10 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function lovebird.onerror(err)
|
function lovebird.onerror(err)
|
||||||
lovebird.trace("ERROR:", err)
|
lovebird.pushline({ type = "error", str = err })
|
||||||
|
if lovebird.wrapprint then
|
||||||
|
lovebird.origprint("[lovebird] ERROR: " .. err)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user