aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-12-02 12:27:33 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2016-12-02 12:28:55 +0100
commitb666ce69265797a4878cd7d302e5903d976b7c78 (patch)
tree263c064bc23a552836547282dcc0d234db613851
parente2bb051bd352bfae50f0ddcbcef844e62fa146fc (diff)
downloadxK-b666ce69265797a4878cd7d302e5903d976b7c78.tar.gz
xK-b666ce69265797a4878cd7d302e5903d976b7c78.tar.xz
xK-b666ce69265797a4878cd7d302e5903d976b7c78.zip
fancy-prompt.lua: change background on highlight
-rw-r--r--plugins/degesch/fancy-prompt.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/degesch/fancy-prompt.lua b/plugins/degesch/fancy-prompt.lua
index c0611f3..1c3bb32 100644
--- a/plugins/degesch/fancy-prompt.lua
+++ b/plugins/degesch/fancy-prompt.lua
@@ -34,6 +34,7 @@ local prompt = degesch.hook_prompt (function (hook)
local chan = current.channel
local s = current.server
+ local bg_color = "255"
local current_n = 0
local active = ""
for i, buffer in ipairs (degesch.buffers) do
@@ -41,7 +42,10 @@ local prompt = degesch.hook_prompt (function (hook)
current_n = i
elseif buffer.new_messages_count ~= buffer.new_unimportant_count then
if active ~= "" then active = active .. "," end
- if buffer.highlighted then active = active .. "!" end
+ if buffer.highlighted then
+ active = active .. "!"
+ bg_color = "224"
+ end
active = active .. i
end
end
@@ -65,8 +69,8 @@ local prompt = degesch.hook_prompt (function (hook)
-- Note that this doesn't count with full-width or zero-width characters.
local overflow = utf8.offset (x, cols - 1)
if overflow then x = x:sub (1, overflow) end
- x = "\x01\x1b[0;4;1;38;5;16m\x1b[48;5;255m\x02" ..
- x .. "\x01\x1b[0;4;1;7;38;5;255m\x02 \x01\x1b[0;1m\x02"
+ x = "\x01\x1b[0;4;1;38;5;16m\x1b[48;5;" .. bg_color .. "m\x02" ..
+ x .. "\x01\x1b[0;4;1;7;38;5;" .. bg_color .. "m\x02 \x01\x1b[0;1m\x02"
local user_prefix = function (chan, user)
for i, chan_user in ipairs (chan.users) do