]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
Add new script send_scroll.pl
authorAilin Nemui <redacted>
Mon, 26 Jan 2015 22:46:22 +0000 (23:46 +0100)
committerAilin Nemui <redacted>
Mon, 26 Jan 2015 22:50:52 +0000 (23:50 +0100)
The send_scroll script scrolls the window to the end before permitting
to send new messages. Useful in case you like to forget this.

scripts/send_scroll.pl [new file with mode: 0644]

diff --git a/scripts/send_scroll.pl b/scripts/send_scroll.pl
new file mode 100644 (file)
index 0000000..5ab502c
--- /dev/null
@@ -0,0 +1,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');
+    }
+});
git clone https://git.99rst.org/PROJECT