diff options
author | Tom Feist <shabble@metavore.org> | 2010-10-13 01:09:42 +0000 |
---|---|---|
committer | Tom Feist <shabble@metavore.org> | 2010-10-13 01:09:42 +0000 |
commit | 9e2e49faf7730daf70b56b4fa35716eb6eefddb3 (patch) | |
tree | a0ab876b5c4e6763a4a606b3a81799a06e096908 /history-search/rl_history_search.pl | |
parent | history search now uses colour to indicate matches/no-matches (diff) | |
download | irssi-scripts-9e2e49faf7730daf70b56b4fa35716eb6eefddb3.tar.gz irssi-scripts-9e2e49faf7730daf70b56b4fa35716eb6eefddb3.zip |
updated history search to use a irssi setting 'histsearch_debug' to enable
debugging output.
Diffstat (limited to 'history-search/rl_history_search.pl')
-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 = ''; |