]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
mh_windowfill.pl v1.05
authormh <redacted>
Sun, 6 Dec 2015 15:38:01 +0000 (16:38 +0100)
committermh <redacted>
Sun, 6 Dec 2015 15:38:01 +0000 (16:38 +0100)
fill windows so scrolling starts bottom-up instead of top-down

changes:
added a few comments

scripts/mh_windowfill.pl

index 770f5381b4b8f1e1e44fa1cf853f3f05b525cc57..550d23943f1484a4174257cc1825a638985a6558 100644 (file)
@@ -1,6 +1,6 @@
 ##############################################################################
 #
-# mh_windowfill.pl v1.04 (20151128)
+# mh_windowfill.pl v1.05 (20151206)
 #
 # Copyright (c) 2015  Michael Hansen
 #
@@ -27,6 +27,8 @@
 #      with script:    http://picpaste.com/e3b84ead852e3e77b12ed69383f1f80c.png
 #
 # history:
+#      v1.05 (20151206)
+#              added a few comments
 #      v1.04 (20151128)
 #              call windowfill* directly from signals
 #              removed on load timeout
@@ -56,7 +58,7 @@ use strict;
 use Irssi 20100403;
 use Irssi::TextUI;
 
-our $VERSION = '1.04';
+our $VERSION = '1.05';
 our %IRSSI   =
 (
        'name'        => 'mh_windowfill',
@@ -103,6 +105,9 @@ sub windowfill
                my $line      = $window->view()->get_lines();
                my $linecount = 0;
 
+               #
+               # count lines we need to move
+               #
                while ($line)
                {
                        $linecount++;
@@ -113,6 +118,9 @@ sub windowfill
 
                $line = $window->view()->get_lines();
 
+               #
+               # move lines down
+               #
                while ($linecount)
                {
                        my $linetext = $line->get_text(1);
@@ -154,13 +162,13 @@ sub command_clear
 #
 ##############################################################################
 
+windowfill_all();
+
 Irssi::signal_add_last('mainwindow resized', 'windowfill_all');
 Irssi::signal_add_last('window created',     'windowfill');
 
 Irssi::command_bind('clear', 'command_clear');
 
-windowfill_all();
-
 1;
 
 ##############################################################################
git clone https://git.99rst.org/PROJECT