{"action":"created","comment":{"url":"https://api.github.com/repos/irssi/scripts.irssi.org/pulls/comments/45055482","id":45055482,"diff_hunk":"@@ -0,0 +1,244 @@\n+##############################################################################\n+#\n+# mh_windowfill.pl v1.00 (20151116)\n+#\n+# Copyright (c) 2015  Michael Hansen\n+#\n+# Permission to use, copy, modify, and distribute this software\n+# for any purpose with or without fee is hereby granted, provided\n+# that the above copyright notice and this permission notice\n+# appear in all copies.\n+#\n+# THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL\n+# WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED\n+# WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL\n+# THE AUTHOR BE LIABLE FOR  ANY SPECIAL, DIRECT, INDIRECT, OR\n+# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n+# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,\n+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN\n+# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n+#\n+##############################################################################\n+#\n+# fill windows so scrolling starts bottom-up instead of top-down\n+#\n+# known issues:\n+# \t- /CLEAR will reset to top-down\n+#\t- it is possible to confuse the script into not filling with a combination\n+#\t  of script load/unloads and window resizes. but it requires effort\n+#\n+# history:\n+#\tv1.00 (20151116)\n+#\t\tinitial release\n+#\n+\n+use v5.14.2;\n+\n+use strict;\n+\n+##############################################################################\n+#\n+# irssi head\n+#\n+##############################################################################\n+\n+use Irssi 20100403;\n+use Irssi::TextUI;\n+\n+our $VERSION = '1.00';\n+our %IRSSI   =\n+(\n+\t'name'        => 'mh_windowfill',\n+\t'description' => 'fill windows so scrolling starts bottom-up instead of top-down',\n+\t'license'     => 'BSD',\n+\t'authors'     => 'Michael Hansen',\n+\t'contact'     => 'mh on IRCnet #help',\n+\t'url'         => 'irc://open.ircnet.net',\n+);\n+\n+##############################################################################\n+#\n+# global variables\n+#\n+##############################################################################\n+\n+our $windowfill_running = 0;\n+\n+##############################################################################\n+#\n+# common support functions\n+#\n+##############################################################################\n+\n+sub trim_spacelike($)\n+{\n+   my ($string) = @_;\n+\n+   if (defined($string))\n+   {\n+      $string =~ s/^\\s+//g;\n+      $string =~ s/\\s+$//g;\n+\n+   } else {\n+\n+      $string = '';\n+   }\n+\n+   return($string);\n+}\n+\n+##############################################################################\n+#\n+# script functions\n+#\n+##############################################################################\n+\n+sub windowfill($)\n+{\n+\tmy ($window) = @_;\n+\n+\tif (ref($window) ne 'Irssi::UI::Window')\n+\t{\n+\t\tdie();\n+\t}\n+\n+\t#\n+\t# fill window with empty lines and move already printed lines to the bottom\n+\t#\n+\tif (($window->view()->{'ypos'} + 2) <= $window->{'height'})\n+\t{\n+\n+\t\twhile (($window->view()->{'ypos'} + 2) <= $window->{'height'})\n+\t\t{\n+\t\t\t$window->print('', MSGLEVEL_CLIENTCRAP | MSGLEVEL_NEVER | MSGLEVEL_NO_ACT | MSGLEVEL_NOHILIGHT);\n+\t\t}\n+\n+\t\tmy $linecount  = $window->{'height'};\n+\t\tmy $line       = $window->view()->get_lines();\n+\n+\t\twhile ((ref($line) eq 'Irssi::TextUI::Line') and $linecount)\n+\t\t{\n+\t\t\tmy $linetext = $line->get_text(1);\n+\n+\t\t\tif ($linetext ne '')\n+\t\t\t{\n+\t\t\t\t# reprint line\n+\t\t\t\t$window->print($linetext, MSGLEVEL_CLIENTCRAP | MSGLEVEL_NEVER | MSGLEVEL_NO_ACT | MSGLEVEL_NOHILIGHT);\n+\t\t\t\t$line = $line->next();\n+\t\t\t\t$window->view()->remove_line($line->prev());\n+\n+\t\t\t} else {\n+\n+\t\t\t\t# skip empty line\n+\t\t\t\t$line = $line->next();\n+\t\t\t}\n+\n+\t\t\t$linecount--;\n+\t\t}\n+\t}\n+\n+\treturn(1);\n+}\n+\n+sub windowfill_all()\n+{\n+\t#\n+\t# fill all windows with empty lines\n+\t#\n+\tfor my $window (Irssi::windows())\n+\t{\n+\t\tif (ref($window) ne 'Irssi::UI::Window')\n+\t\t{\n+\t\t\tdie();\n+\t\t}\n+\n+\t\twindowfill($window);\n+\t}\n+\n+\treturn(1);\n+}\n+\n+##############################################################################\n+#\n+# irssi signal handlers\n+#\n+##############################################################################\n+\n+sub signal_mainwindow_resized_last()\n+{\n+\tif ($windowfill_running)\n+\t{\n+\t\t#\n+\t\t# fill all windows with empty lines\n+\t\t#\n+\t\twindowfill_all();\n+\t}\n+\n+\treturn(1);\n+}\n+\n+Irssi::signal_add_last('mainwindow resized', 'signal_mainwindow_resized_last');\n+\n+sub signal_window_created_last($)\n+{\n+\tmy ($window) = @_;\n+\n+\tif (ref($window) ne 'Irssi::UI::Window')\n+\t{\n+\t\tdie();\n+\t}\n+\n+\tif ($windowfill_running)\n+\t{\n+\t\t#\n+\t\t# fill created window with empty lines\n+\t\t#\n+\t\twindowfill($window);\n+\t}\n+\n+\treturn(1);\n+}\n+\n+Irssi::signal_add_last('window created', 'signal_window_created_last');\n+\n+##############################################################################\n+#\n+# script on load\n+#\n+##############################################################################\n+\n+sub script_on_load($)\n+{\n+\tmy ($undef) = @_;\n+\n+\tif (defined($undef))","path":"scripts/mh_windowfill.pl","position":214,"original_position":214,"commit_id":"c3bf865a54edacd82af48b68b36749e263bbb25e","original_commit_id":"c3bf865a54edacd82af48b68b36749e263bbb25e","user":{"login":"mh-source","id":6559373,"avatar_url":"https://avatars.githubusercontent.com/u/6559373?v=3","gravatar_id":"","url":"https://api.github.com/users/mh-source","html_url":"https://github.com/mh-source","followers_url":"https://api.github.com/users/mh-source/followers","following_url":"https://api.github.com/users/mh-source/following{/other_user}","gists_url":"https://api.github.com/users/mh-source/gists{/gist_id}","starred_url":"https://api.github.com/users/mh-source/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mh-source/subscriptions","organizations_url":"https://api.github.com/users/mh-source/orgs","repos_url":"https://api.github.com/users/mh-source/repos","events_url":"https://api.github.com/users/mh-source/events{/privacy}","received_events_url":"https://api.github.com/users/mh-source/received_events","type":"User","site_admin":false},"body":"Agreed, i have a #ifdef <PARANOID> that does a lot of what you call useless, and i call extra safetynets, i do plan on removing the safetynets later if i find the script to behave stable","created_at":"2015-11-17T12:48:53Z","updated_at":"2015-11-17T12:48:53Z","html_url":"https://github.com/irssi/scripts.irssi.org/pull/172#discussion_r45055482","pull_request_url":"https://api.github.com/repos/irssi/scripts.irssi.org/pulls/172","_links":{"self":{"href":"https://api.github.com/repos/irssi/scripts.irssi.org/pulls/comments/45055482"},"html":{"href":"https://github.com/irssi/scripts.irssi.org/pull/172#discussion_r45055482"},"pull_request":{"href":"https://api.github.com/repos/irssi/scripts.irssi.org/pulls/172"}}},"pull_request":{"url":"https://api.github.com/repos/irssi/scripts.irssi.org/pulls/172","id":50780898,"html_url":"https://github.com/irssi/scripts.irssi.org/pull/172","diff_url":"https://github.com/irssi/scripts.irssi.org/pull/172.diff","patch_url":"https://github.com/irssi/scripts.irssi.org/pull/172.patch","issue_url":"https://api.github.com/repos/irssi/scripts.irssi.org/issues/172","number":172,"state":"open","locked":false,"title":"mh_windowfill","user":{"login":"mh-source","id":6559373,"avatar_url":"https://avatars.githubusercontent.com/u/6559373?v=3","gravatar_id":"","url":"https://api.github.com/users/mh-source","html_url":"https://github.com/mh-source","followers_url":"https://api.github.com/users/mh-source/followers","following_url":"https://api.github.com/users/mh-source/following{/other_user}","gists_url":"https://api.github.com/users/mh-source/gists{/gist_id}","starred_url":"https://api.github.com/users/mh-source/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mh-source/subscriptions","organizations_url":"https://api.github.com/users/mh-source/orgs","repos_url":"https://api.github.com/users/mh-source/repos","events_url":"https://api.github.com/users/mh-source/events{/privacy}","received_events_url":"https://api.github.com/users/mh-source/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-16T08:05:13Z","updated_at":"2015-11-17T12:48:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2bc613e263b8f797e29a33fc6319723dc37d90e8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/irssi/scripts.irssi.org/pulls/172/commits","review_comments_url":"https://api.github.com/repos/irssi/scripts.irssi.org/pulls/172/comments","review_comment_url":"https://api.github.com/repos/irssi/scripts.irssi.org/pulls/comments{/number}","comments_url":"https://api.github.com/repos/irssi/scripts.irssi.org/issues/172/comments","statuses_url":"https://api.github.com/repos/irssi/scripts.irssi.org/statuses/c3bf865a54edacd82af48b68b36749e263bbb25e","head":{"label":"mh-source:gh-pages","ref":"gh-pages","sha":"c3bf865a54edacd82af48b68b36749e263bbb25e","user":{"login":"mh-source","id":6559373,"avatar_url":"https://avatars.githubusercontent.com/u/6559373?v=3","gravatar_id":"","url":"https://api.github.com/users/mh-source","html_url":"https://github.com/mh-source","followers_url":"https://api.github.com/users/mh-source/followers","following_url":"https://api.github.com/users/mh-source/following{/other_user}","gists_url":"https://api.github.com/users/mh-source/gists{/gist_id}","starred_url":"https://api.github.com/users/mh-source/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mh-source/subscriptions","organizations_url":"https://api.github.com/users/mh-source/orgs","repos_url":"https://api.github.com/users/mh-source/repos","events_url":"https://api.github.com/users/mh-source/events{/privacy}","received_events_url":"https://api.github.com/users/mh-source/received_events","type":"User","site_admin":false},"repo":{"id":46241384,"name":"scripts.irssi.org","full_name":"mh-source/scripts.irssi.org","owner":{"login":"mh-source","id":6559373,"avatar_url":"https://avatars.githubusercontent.com/u/6559373?v=3","gravatar_id":"","url":"https://api.github.com/users/mh-source","html_url":"https://github.com/mh-source","followers_url":"https://api.github.com/users/mh-source/followers","following_url":"https://api.github.com/users/mh-source/following{/other_user}","gists_url":"https://api.github.com/users/mh-source/gists{/gist_id}","starred_url":"https://api.github.com/users/mh-source/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mh-source/subscriptions","organizations_url":"https://api.github.com/users/mh-source/orgs","repos_url":"https://api.github.com/users/mh-source/repos","events_url":"https://api.github.com/users/mh-source/events{/privacy}","received_events_url":"https://api.github.com/users/mh-source/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mh-source/scripts.irssi.org","description":"Script Repository for Irssi","fork":true,"url":"https://api.github.com/repos/mh-source/scripts.irssi.org","forks_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/forks","keys_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/teams","hooks_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/hooks","issue_events_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/issues/events{/number}","events_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/events","assignees_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/assignees{/user}","branches_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/branches{/branch}","tags_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/tags","blobs_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/statuses/{sha}","languages_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/languages","stargazers_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/stargazers","contributors_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/contributors","subscribers_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/subscribers","subscription_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/subscription","commits_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/issues/comments{/number}","contents_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/contents/{+path}","compare_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/merges","archive_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/downloads","issues_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/issues{/number}","pulls_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/pulls{/number}","milestones_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/milestones{/number}","notifications_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/labels{/name}","releases_url":"https://api.github.com/repos/mh-source/scripts.irssi.org/releases{/id}","created_at":"2015-11-15T23:48:35Z","updated_at":"2015-11-15T23:48:38Z","pushed_at":"2015-11-16T07:59:08Z","git_url":"git://github.com/mh-source/scripts.irssi.org.git","ssh_url":"git@github.com:mh-source/scripts.irssi.org.git","clone_url":"https://github.com/mh-source/scripts.irssi.org.git","svn_url":"https://github.com/mh-source/scripts.irssi.org","homepage":"scripts.irssi.org","size":3762,"stargazers_count":0,"watchers_count":0,"language":"Perl","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"gh-pages"}},"base":{"label":"irssi:gh-pages","ref":"gh-pages","sha":"172c9236cf5ffb361fd9ef188b8a3c9b0b5cac1f","user":{"login":"irssi","id":7750489,"avatar_url":"https://avatars.githubusercontent.com/u/7750489?v=3","gravatar_id":"","url":"https://api.github.com/users/irssi","html_url":"https://github.com/irssi","followers_url":"https://api.github.com/users/irssi/followers","following_url":"https://api.github.com/users/irssi/following{/other_user}","gists_url":"https://api.github.com/users/irssi/gists{/gist_id}","starred_url":"https://api.github.com/users/irssi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irssi/subscriptions","organizations_url":"https://api.github.com/users/irssi/orgs","repos_url":"https://api.github.com/users/irssi/repos","events_url":"https://api.github.com/users/irssi/events{/privacy}","received_events_url":"https://api.github.com/users/irssi/received_events","type":"Organization","site_admin":false},"repo":{"id":20343944,"name":"scripts.irssi.org","full_name":"irssi/scripts.irssi.org","owner":{"login":"irssi","id":7750489,"avatar_url":"https://avatars.githubusercontent.com/u/7750489?v=3","gravatar_id":"","url":"https://api.github.com/users/irssi","html_url":"https://github.com/irssi","followers_url":"https://api.github.com/users/irssi/followers","following_url":"https://api.github.com/users/irssi/following{/other_user}","gists_url":"https://api.github.com/users/irssi/gists{/gist_id}","starred_url":"https://api.github.com/users/irssi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irssi/subscriptions","organizations_url":"https://api.github.com/users/irssi/orgs","repos_url":"https://api.github.com/users/irssi/repos","events_url":"https://api.github.com/users/irssi/events{/privacy}","received_events_url":"https://api.github.com/users/irssi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/irssi/scripts.irssi.org","description":"Script Repository for Irssi","fork":false,"url":"https://api.github.com/repos/irssi/scripts.irssi.org","forks_url":"https://api.github.com/repos/irssi/scripts.irssi.org/forks","keys_url":"https://api.github.com/repos/irssi/scripts.irssi.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/irssi/scripts.irssi.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/irssi/scripts.irssi.org/teams","hooks_url":"https://api.github.com/repos/irssi/scripts.irssi.org/hooks","issue_events_url":"https://api.github.com/repos/irssi/scripts.irssi.org/issues/events{/number}","events_url":"https://api.github.com/repos/irssi/scripts.irssi.org/events","assignees_url":"https://api.github.com/repos/irssi/scripts.irssi.org/assignees{/user}","branches_url":"https://api.github.com/repos/irssi/scripts.irssi.org/branches{/branch}","tags_url":"https://api.github.com/repos/irssi/scripts.irssi.org/tags","blobs_url":"https://api.github.com/repos/irssi/scripts.irssi.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/irssi/scripts.irssi.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/irssi/scripts.irssi.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/irssi/scripts.irssi.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/irssi/scripts.irssi.org/statuses/{sha}","languages_url":"https://api.github.com/repos/irssi/scripts.irssi.org/languages","stargazers_url":"https://api.github.com/repos/irssi/scripts.irssi.org/stargazers","contributors_url":"https://api.github.com/repos/irssi/scripts.irssi.org/contributors","subscribers_url":"https://api.github.com/repos/irssi/scripts.irssi.org/subscribers","subscription_url":"https://api.github.com/repos/irssi/scripts.irssi.org/subscription","commits_url":"https://api.github.com/repos/irssi/scripts.irssi.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/irssi/scripts.irssi.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/irssi/scripts.irssi.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/irssi/scripts.irssi.org/issues/comments{/number}","contents_url":"https://api.github.com/repos/irssi/scripts.irssi.org/contents/{+path}","compare_url":"https://api.github.com/repos/irssi/scripts.irssi.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/irssi/scripts.irssi.org/merges","archive_url":"https://api.github.com/repos/irssi/scripts.irssi.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/irssi/scripts.irssi.org/downloads","issues_url":"https://api.github.com/repos/irssi/scripts.irssi.org/issues{/number}","pulls_url":"https://api.github.com/repos/irssi/scripts.irssi.org/pulls{/number}","milestones_url":"https://api.github.com/repos/irssi/scripts.irssi.org/milestones{/number}","notifications_url":"https://api.github.com/repos/irssi/scripts.irssi.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/irssi/scripts.irssi.org/labels{/name}","releases_url":"https://api.github.com/repos/irssi/scripts.irssi.org/releases{/id}","created_at":"2014-05-30T22:08:11Z","updated_at":"2015-11-16T08:41:04Z","pushed_at":"2015-11-17T08:46:42Z","git_url":"git://github.com/irssi/scripts.irssi.org.git","ssh_url":"git@github.com:irssi/scripts.irssi.org.git","clone_url":"https://github.com/irssi/scripts.irssi.org.git","svn_url":"https://github.com/irssi/scripts.irssi.org","homepage":"scripts.irssi.org","size":2779,"stargazers_count":210,"watchers_count":210,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":114,"mirror_url":null,"open_issues_count":10,"forks":114,"open_issues":10,"watchers":210,"default_branch":"gh-pages"}},"_links":{"self":{"href":"https://api.github.com/repos/irssi/scripts.irssi.org/pulls/172"},"html":{"href":"https://github.com/irssi/scripts.irssi.org/pull/172"},"issue":{"href":"https://api.github.com/repos/irssi/scripts.irssi.org/issues/172"},"comments":{"href":"https://api.github.com/repos/irssi/scripts.irssi.org/issues/172/comments"},"review_comments":{"href":"https://api.github.com/repos/irssi/scripts.irssi.org/pulls/172/comments"},"review_comment":{"href":"https://api.github.com/repos/irssi/scripts.irssi.org/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/irssi/scripts.irssi.org/pulls/172/commits"},"statuses":{"href":"https://api.github.com/repos/irssi/scripts.irssi.org/statuses/c3bf865a54edacd82af48b68b36749e263bbb25e"}}}}