diff options
author | Tom Feist <shabble@metavore.org> | 2010-12-13 05:41:34 +0000 |
---|---|---|
committer | Tom Feist <shabble@metavore.org> | 2010-12-13 05:41:34 +0000 |
commit | fc22fe935c828a7373c1f534d2939a127c2cbaea (patch) | |
tree | b93c7302ce9418f82ff5d1df82e9283cb59c6ace /history-search/rl_history_search.pl | |
parent | ido_switch: only use levelclear when necessary (after something has been prin... (diff) | |
download | irssi-scripts-fc22fe935c828a7373c1f534d2939a127c2cbaea.tar.gz irssi-scripts-fc22fe935c828a7373c1f534d2939a127c2cbaea.zip |
history-search/rl_history_search: fix to make sure init() is called after
attempting to load uberprompt (or not) appropriately.
Diffstat (limited to 'history-search/rl_history_search.pl')
-rw-r--r-- | history-search/rl_history_search.pl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/history-search/rl_history_search.pl b/history-search/rl_history_search.pl index fcdde8b..ca45fe5 100644 --- a/history-search/rl_history_search.pl +++ b/history-search/rl_history_search.pl @@ -90,22 +90,29 @@ sub script_is_loaded { return $retval; } -unless (script_is_loaded('uberprompt')) { +if (not script_is_loaded('uberprompt')) { + print "This script requires 'uberprompt.pl' in order to work. " . "Attempting to load it now..."; - Irssi::signal_add('script error', \&load_uberprompt_failed); + + Irssi::signal_add('script error', 'load_uberprompt_failed'); Irssi::command("script load uberprompt.pl"); + unless(script_is_loaded('uberprompt')) { load_uberprompt_failed("File does not exist"); } history_init(); +} else { + history_init(); } sub load_uberprompt_failed { - Irssi::signal_remove('script error', \&load_prompt_failed); + Irssi::signal_remove('script error', 'load_prompt_failed'); + print "Script could not be loaded. Script cannot continue. " . "Check you have uberprompt.pl installed in your path and " . "try again."; + die "Script Load Failed: " . join(" ", @_); } |