From 0bf306b98d9d2493001c6b505533d0928f6cec67 Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Wed, 6 Oct 2010 22:43:45 +0100 Subject: fixed a bug causing prompt to not get updated properly, and added a nasty compat hack so things expecting prompt_Info will still load. --- prompt_info/prompt_replace.pl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/prompt_info/prompt_replace.pl b/prompt_info/prompt_replace.pl index 9abf66d..350d74f 100644 --- a/prompt_info/prompt_replace.pl +++ b/prompt_info/prompt_replace.pl @@ -22,7 +22,7 @@ our %IRSSI = sub DEBUG () { 1 } #sub DEBUG () { 0 } -my $prompt_data = ''; +my $prompt_data = undef; my $prompt_item = undef; my $region_active = 0; @@ -124,7 +124,8 @@ sub change_prompt_sig { $text = '$p' . $text; print "Got prompt change sig with: $text" if DEBUG; - my $changed = ($prompt_data ne $text); + my $changed; + $changed = defined $prompt_data ? $prompt_data ne $text : 1; $prompt_data = $text; @@ -213,7 +214,7 @@ sub cmd_toggle_visual { my $str = substr($input, $region_start, $region_end - $region_start); print "Region selected: $str" if DEBUG; } else { - print "Invalid region selection: [ $region_start - $region_end ]" + print "Invalid region selection: [ $region_start - $region_end ]" if DEBUG; $region_start = $region_end = 0; } @@ -316,3 +317,8 @@ sub _sbar_command { sub _pos { return Irssi::gui_input_get_pos(); } + + +# bit of fakery so things don't complain about the lack of prompt_info (hoepfully) + +%Irssi::Script::prompt_info:: = (); -- cgit v1.2.3