diff options
author | Tom Feist <shabble@metavore.org> | 2010-12-02 01:36:00 +0000 |
---|---|---|
committer | Tom Feist <shabble@metavore.org> | 2010-12-02 01:36:00 +0000 |
commit | b22280a2a7444a89899c3a8ff234eee6c4026f25 (patch) | |
tree | d99b60797b22d6a91b0542c4fff27597716e1d84 /sb-position/sb_position.pl | |
parent | sb_position: added a (presumably) working version of rudi_s' scrollback posit... (diff) | |
download | irssi-scripts-b22280a2a7444a89899c3a8ff234eee6c4026f25.tar.gz irssi-scripts-b22280a2a7444a89899c3a8ff234eee6c4026f25.zip |
sb_position: moved register and sig code into init(), weird hacky bugfix for FS#242
Diffstat (limited to 'sb-position/sb_position.pl')
-rw-r--r-- | sb-position/sb_position.pl | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/sb-position/sb_position.pl b/sb-position/sb_position.pl index 813ee31..61e5978 100644 --- a/sb-position/sb_position.pl +++ b/sb-position/sb_position.pl @@ -20,9 +20,11 @@ use strict; use warnings; -use Irssi (); +use Irssi; use POSIX qw(ceil); +{ package Irssi::Nick } + our $VERSION = '0.1'; our %IRSSI = ( authors => 'Simon Ruderich, Tom Feist', @@ -36,20 +38,22 @@ our %IRSSI = ( my ($buf, $size, $pos, $height); my ($pages, $cur_page, $buf_percent); -# (re-)register it so we can access the WIN_REC object directly. -Irssi::signal_register({'gui page scrolled' => [qw/Irssi::UI::Window/]}); -# primary update signal. -Irssi::signal_add('gui page scrolled', \&update_position); -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("gui print text finished", sig_statusbar_more_updated); init(); sub init { + + # (re-)register it so we can access the WIN_REC object directly. + Irssi::signal_register({'gui page scrolled' => [qw/Irssi::UI::Window/]}); + # primary update signal. + Irssi::signal_add('gui page scrolled', \&update_position); + 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("gui print text finished", sig_statusbar_more_updated); + update_position(Irssi::active_win()); } |