From 871ae4a7a178b60c7d779a9d9987c76422fbfc18 Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Sat, 4 Dec 2010 05:25:40 +0000 Subject: uberprompt: have the debug_prompt_changed handler added/removed appropriately when toggling the _debug flag. --- prompt_info/uberprompt.pl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'prompt_info') diff --git a/prompt_info/uberprompt.pl b/prompt_info/uberprompt.pl index 41803d8..8a9f50b 100644 --- a/prompt_info/uberprompt.pl +++ b/prompt_info/uberprompt.pl @@ -235,10 +235,6 @@ sub init { Irssi::signal_register({'prompt length request' => []}); Irssi::signal_add('prompt length request', \&length_request_handler); - - if (DEBUG) { - Irssi::signal_add 'prompt changed', \&debug_prompt_changed; - } } sub refresh_if_me { @@ -277,6 +273,13 @@ sub reload_settings { $DEBUG_ENABLED = Irssi::settings_get_bool('uberprompt_debug'); + if (DEBUG) { + Irssi::signal_add 'prompt changed', 'debug_prompt_changed'; + } else { + Irssi::signal_remove 'prompt changed', 'debug_prompt_changed'; + } + + my $new = Irssi::settings_get_str('uberprompt_format'); if ($prompt_format ne $new) { -- cgit v1.2.3