summaryrefslogtreecommitdiffstats
path: root/scripts/mh_windowfill.pl
diff options
context:
space:
mode:
authormh2015-12-06 16:38:01 +0100
committermh2015-12-06 16:38:01 +0100
commit6cfee255ae923dde8eb519c894e114f5eba2f355 (patch)
tree27e7587880d6565479627f6a8049e4c1da95b14d /scripts/mh_windowfill.pl
parent8ed021da54e70c912899c1a16926654b8ff1f7a4 (diff)
downloadscripts.irssi.org-6cfee255ae923dde8eb519c894e114f5eba2f355.tar.bz2
mh_windowfill.pl v1.05
fill windows so scrolling starts bottom-up instead of top-down changes: added a few comments
Diffstat (limited to 'scripts/mh_windowfill.pl')
-rw-r--r--scripts/mh_windowfill.pl16
1 files changed, 12 insertions, 4 deletions
diff --git a/scripts/mh_windowfill.pl b/scripts/mh_windowfill.pl
index 770f538..550d239 100644
--- a/scripts/mh_windowfill.pl
+++ b/scripts/mh_windowfill.pl
@@ -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;
##############################################################################