From b32bdd9d958cf15e9c4df175d7d3fea3276b51f1 Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Thu, 2 Dec 2010 01:54:59 +0000 Subject: sb_position: /sb commands now work and cause the update as expected --- sb-position/sb_position.pl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'sb-position') diff --git a/sb-position/sb_position.pl b/sb-position/sb_position.pl index 61e5978..744229f 100644 --- a/sb-position/sb_position.pl +++ b/sb-position/sb_position.pl @@ -50,13 +50,20 @@ sub init { Irssi::statusbar_item_register('position', 0, 'position_statusbar'); Irssi::signal_add("window changed", \&update_position); - Irssi::signal_add_last("command clear", \&update_position); - Irssi::signal_add_last("command scrollback", \&update_position); + Irssi::signal_add_last("command clear", \&update_cmd_shim); + Irssi::signal_add_last("command scrollback", \&update_cmd_shim); # Irssi::signal_add_last("gui print text finished", sig_statusbar_more_updated); update_position(Irssi::active_win()); } +sub update_cmd_shim { + my ($cmd, $server, $witem) = @_; + return unless $witem; + my $win = $witem->window; + update_position($win); +} + sub update_position { my $win = shift; -- cgit v1.2.3