]> git.rmz.io Git - dotfiles.git/blobdiff - weechat/perl/highmon.pl
weechat: update plugins
[dotfiles.git] / weechat / perl / highmon.pl
index 967f973d7d16e48f9c0358b3f44e38e64e47bcd2..2aeb1de5c57080f632538c64f717c676c5f3a6b1 100644 (file)
@@ -1,6 +1,6 @@
 #
 # 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
 #
@@ -66,6 +66,8 @@
 # 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>:
@@ -852,13 +854,14 @@ sub highmon_print
                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
                {
@@ -1068,7 +1071,7 @@ sub format_buffer_name
 }
 
 # 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");