diff options
Diffstat (limited to 'history-search')
-rw-r--r-- | history-search/rl_history_search.pl | 15 |
1 files changed, 13 insertions, 2 deletions
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 = ''; |