summaryrefslogtreecommitdiffstats
path: root/scripts/send_scroll.pl
blob: 5ab502ccc369be4fc923c83d75767cb47c1fc62f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use strict;
use warnings;
use Irssi;
use Irssi::TextUI;

# other variations on the theme: scrolling.pl scrollwarn.pl scrolled_reminder.pl antisboops.pl

our $VERSION = '0.1'; # f030fec17903eb6
our %IRSSI = (
    contact     => 'Nei @ anti@conference.jabber.teamidiot.de',
    url         => "http://anti.teamidiot.de/",
    name	=> 'send_scroll',
    description	=> 'Scroll down on enter',
    license     => 'GNU GPLv2 or later',
);

Irssi::signal_add('key send_line' => sub {
    return unless -1 == index Irssi::parse_special('$K'), Irssi::parse_special('$[1]L');
    my $win = Irssi::active_win;
    my $view = $win->view;
    unless ($view->{bottom}) {
        Irssi::signal_stop;
        $win->command('scrollback end');
    }
});