#
# highmon.pl - Highlight Monitoring for weechat 0.3.0
-# Version 2.3.3.2
+# Version 2.4
#
# Add 'Highlight Monitor' buffer/bar to log all highlights in one spot
#
# Bugs and feature requests at: https://github.com/KenjiE20/highmon
# History:
+# 2013-12-04, KenjiE20 <longbow@longbowslair.co.uk>:
+# v2.4: -add: Support for eval style colour codes in time format used for bar output
# 2013-10-22, KenjiE20 <longbow@longbowslair.co.uk>:
# v2.3.3.2: -fix: Typo in fix command
# 2013-10-10, KenjiE20 <longbow@longbowslair.co.uk>:
use POSIX qw(strftime);
$time = strftime(weechat::config_string(weechat::config_get("weechat.look.buffer_time_format")), localtime);
# Colourise
- if ($time =~ /\$\{\w+\}/) # Coloured string
+ if ($time =~ /\$\{(?:color:)?[\w,]+\}/) # Coloured string
{
- while ($time =~ /\$\{(\w+)\}/)
+ while ($time =~ /\$\{(?:color:)?([\w,]+)\}/)
{
$color = weechat::color($1);
- $time =~ s/\$\{\w+\}/$color/;
+ $time =~ s/\$\{(?:color:)?[\w,]+\}/$color/;
}
+ $time .= weechat::color("reset");
}
else # Default string
{
}
# Check result of register, and attempt to behave in a sane manner
-if (!weechat::register("highmon", "KenjiE20", "2.3.3.2", "GPL3", "Highlight Monitor", "", ""))
+if (!weechat::register("highmon", "KenjiE20", "2.4", "GPL3", "Highlight Monitor", "", ""))
{
# Double load
weechat::print ("", "\tHighmon is already loaded");