From 9e2e49faf7730daf70b56b4fa35716eb6eefddb3 Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Wed, 13 Oct 2010 02:09:42 +0100 Subject: updated history search to use a irssi setting 'histsearch_debug' to enable debugging output. --- history-search/rl_history_search.pl | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'history-search') diff --git a/history-search/rl_history_search.pl b/history-search/rl_history_search.pl index 64f4f20..32d42a3 100644 --- a/history-search/rl_history_search.pl +++ b/history-search/rl_history_search.pl @@ -75,7 +75,8 @@ my @search_matches = (); my $match_index = 0; -sub DEBUG () { 0 } +my $DEBUG_ENABLED = 0; +sub DEBUG () { $DEBUG_ENABLED } # check we have uberprompt loaded. @@ -97,11 +98,21 @@ unless (script_is_loaded('uberprompt')) { } sub history_init { + Irssi::settings_add_bool('history_search', 'histsearch_debug', 0); + Irssi::command_bind('history_search_start', \&history_search); - #Irssi::command_bind('history_search_exit', \&history_search_exit); + + Irssi::signal_add ('setup changed' => \&setup_changed); Irssi::signal_add_first('gui key pressed' => \&handle_keypress); + + setup_changed(); } +sub setup_changed { + $DEBUG_ENABLED = Irssi::settings_get_bool('histsearch_debug'); +} + + sub history_search { $search_active = 1; $search_str = ''; -- cgit v1.2.3