aboutsummaryrefslogtreecommitdiffstats
path: root/weechat/perl/highmon.pl
diff options
context:
space:
mode:
Diffstat (limited to 'weechat/perl/highmon.pl')
-rw-r--r--weechat/perl/highmon.pl32
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");