diff options
author | Tom Feist <shabble@metavore.org> | 2010-10-09 16:58:39 +0000 |
---|---|---|
committer | Tom Feist <shabble@metavore.org> | 2010-10-09 16:58:39 +0000 |
commit | 217d7296f79de207639bf4d47cbfd15d54ec5129 (patch) | |
tree | 120252e4dabc7362875ab6d2f207c87240595f74 /prompt_info/uberprompt.pl | |
parent | documented uberprompt better, and added the 'prompt changed' signal (diff) | |
download | irssi-scripts-217d7296f79de207639bf4d47cbfd15d54ec5129.tar.gz irssi-scripts-217d7296f79de207639bf4d47cbfd15d54ec5129.zip |
added some debug logging to catch 'prompt changed'
Diffstat (limited to 'prompt_info/uberprompt.pl')
-rw-r--r-- | prompt_info/uberprompt.pl | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/prompt_info/uberprompt.pl b/prompt_info/uberprompt.pl index 6c012c4..6056d3f 100644 --- a/prompt_info/uberprompt.pl +++ b/prompt_info/uberprompt.pl @@ -67,7 +67,7 @@ use Data::Dumper; -our $VERSION = "0.1"; +our $VERSION = "0.2"; our %IRSSI = ( authors => "shabble", @@ -83,7 +83,7 @@ sub DEBUG () { 1 } #sub DEBUG () { 0 } my $prompt_data = undef; -my $prompt_item = undef; +#my $prompt_item = undef; my $prompt_format = ''; @@ -126,6 +126,16 @@ sub init { # this event to be notified when the prompt changes. # arguments are new contents (string), new length (int) Irssi::signal_register({'prompt changed' => [qw/string int/]}); + if (DEBUG) { + Irssi::signal_add 'prompt changed', \&debug_prompt_changed; + } +} + +sub debug_prompt_changed { + my ($text, $len) = @_; + my $exp = Irssi::current_theme()->format_expand($text, 0); + my $ps = Irssi::parse_special($exp); + print "DEBUG: Got $text = $exp = $ps, length: $len"; } sub change_prompt_sig { @@ -192,8 +202,6 @@ sub uberprompt_draw { print "Redrawing with: $p_copy, size-only: $get_size_only" if DEBUG; - $prompt_item = $sb_item; - my $ret = $sb_item->default_handler($get_size_only, $p_copy, '', 0); # TODO: do this properly, and also make sure it's only emitted once per # change. |