From 3c0db4f4e33a2dd6aaf3be28d4b17402c5273039 Mon Sep 17 00:00:00 2001 From: rxi Date: Sat, 28 Jun 2014 14:47:12 +0100 Subject: [PATCH] Added special CSS formatting for lovebird errors --- lovebird.lua | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/lovebird.lua b/lovebird.lua index 6ed2d0a..22fde83 100644 --- a/lovebird.lua +++ b/lovebird.lua @@ -73,6 +73,18 @@ end border-radius: 7px; 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 { margin: 12px; background: #F0F0F0; @@ -88,6 +100,9 @@ end content: '\00B7\00B7\00B7'; padding-right: 5px; } + .errorline { + color: #8E0000; + } #header { background: #101010; height: 25px; @@ -388,6 +403,7 @@ function lovebird.init() lovebird.addr, lovebird.port = lovebird.server:getsockname() lovebird.server:settimeout(0) -- Wrap print + lovebird.origprint = print if lovebird.wrapprint then local oldprint = print print = function(...) @@ -511,6 +527,10 @@ function lovebird.recalcbuffer() if line.type == "input" then str = '' .. str .. '' else + if line.type == "error" then + str = '! ' .. str + str = '' .. str .. '' + end if line.count > 1 then str = '' .. line.count .. ' ' .. str end @@ -545,7 +565,10 @@ end 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