diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2014-02-18 16:56:41 +0100 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2014-02-18 16:56:41 +0100 |
commit | 9c9e27b7bfc9c00acc02b91fdb8cb29c60fe546e (patch) | |
tree | 6e0486088938bbb8a88efe5c2639b807b0ddd23a /weechat/perl/highmon.pl | |
parent | 7e7aa928072775240ff70ca61f2dd0e8a09242d8 (diff) | |
download | dotfiles-9c9e27b7bfc9c00acc02b91fdb8cb29c60fe546e.tar.xz |
…
Diffstat (limited to 'weechat/perl/highmon.pl')
-rw-r--r-- | weechat/perl/highmon.pl | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/weechat/perl/highmon.pl b/weechat/perl/highmon.pl index b7e0aae..2aeb1de 100644 --- a/weechat/perl/highmon.pl +++ b/weechat/perl/highmon.pl @@ -1,6 +1,6 @@ # # highmon.pl - Highlight Monitoring for weechat 0.3.0 -# Version 2.3.2 +# Version 2.4 # # Add 'Highlight Monitor' buffer/bar to log all highlights in one spot # @@ -66,6 +66,14 @@ # 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>: +# v2.3.3.1: -fix: Typo in closed buffer warning +# 2013-10-07, KenjiE20 <longbow@longbowslair.co.uk>: +# v2.3.3: -add: Warning and fixer for accidental buffer closes # 2013-01-15, KenjiE20 <longbow@longbowslair.co.uk>: # v2.3.2: -fix: Let bar output use the string set in weechat's config option # -add: github info @@ -302,6 +310,11 @@ sub highmon_buffer_input sub highmon_buffer_close { $highmon_buffer = ""; + # If user hasn't changed output style warn user + if (weechat::config_get_plugin("output") eq "buffer") + { + weechat::print("", "\tHighmon buffer has been closed but output is still set to buffer, unusual results may occur. To recreate the buffer use ".weechat::color("bold")."/highmon fix".weechat::color("-bold")); + } return weechat::WEECHAT_RC_OK; } @@ -342,6 +355,14 @@ sub highmon_command_cb { highmon_config_clean($data, $buffer, $arg); } + # Fix closed buffer + elsif ($cmd eq "fix") + { + if (weechat::config_get_plugin("output") eq "buffer" && $highmon_buffer eq "") + { + highmon_buffer_open(); + } + } return weechat::WEECHAT_RC_OK; } @@ -833,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 { @@ -1049,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.2", "GPL3", "Highlight Monitor", "", "")) +if (!weechat::register("highmon", "KenjiE20", "2.4", "GPL3", "Highlight Monitor", "", "")) { # Double load weechat::print ("", "\tHighmon is already loaded"); |