aboutsummaryrefslogtreecommitdiffstats
path: root/prompt_info/prompt_replace.pl
diff options
context:
space:
mode:
authorTom Feist <shabble@metavore.org>2010-10-06 21:43:45 +0000
committerTom Feist <shabble@metavore.org>2010-10-06 21:43:45 +0000
commit0bf306b98d9d2493001c6b505533d0928f6cec67 (patch)
treea80be958fa0931ce39ff204fdc9a504e4fbc2bb5 /prompt_info/prompt_replace.pl
parentmodified the API signal handling to prepend $p by default (as prompt_info sort (diff)
downloadirssi-scripts-0bf306b98d9d2493001c6b505533d0928f6cec67.tar.gz
irssi-scripts-0bf306b98d9d2493001c6b505533d0928f6cec67.zip
fixed a bug causing prompt to not get updated properly, and added a nasty compat
hack so things expecting prompt_Info will still load.
Diffstat (limited to 'prompt_info/prompt_replace.pl')
-rw-r--r--prompt_info/prompt_replace.pl12
1 files 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:: = ();