-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: rxvt-unicode-sixel
action: commit
revision:
path_from:
revision_from: 2f0435e81d48f9a86b3535ce4af8a34688880585:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

git://git.thebackupbox.net/rxvt-unicode-sixel

commit 2f0435e81d48f9a86b3535ce4af8a34688880585
Author: Emanuele Giaquinta <emanuele.giaquinta@gmail.com>
Date:   Mon Jul 12 15:08:46 2021 +0000

    Improve eval scroll actions

    eval scroll actions now scroll to the bottom when scrolling down and
    there are less lines to scroll than the ones requested.

    Patch by Stephen Talley.

diff --git a/Changes b/Changes

index 6bbedad10a04fdc1de08025ecdcf8bc79b8bc323..

index ..3402d8519f727cdceb9f39707829de60b0bc7ee2 100644

--- a/Changes
+++ b/Changes
@@ -61,6 +61,9 @@ TODO: clean up the resource vs. long option mess, especially in the manpage.
           is now under frills.
 	- enable confirm-paste extension by default, can be disabled by e.g.
           URxvt.perl-ext: -confirm-paste
+	- eval scroll actions now scroll to the bottom when scrolling down and
+	  there are less lines to scroll than the ones requested (patch by
+	  Stephen Talley).
 	- if urxvt cannot detect a good estimate for font width (because a font does
           not contain latin characters at all for example), it will now fall
           back to xft's max_advance_width, which works well with some fonts. It
diff --git a/src/perl/eval b/src/perl/eval

index 1f38c3b2330fc534c28a7cf9e0e927e0d51d73e7..

index ..8ce7e048af8071ffadc6e84de9779e17136da307 100644

--- a/src/perl/eval
+++ b/src/perl/eval
@@ -43,22 +43,22 @@ Scroll up or down by C<$count> lines or pages.

 sub scroll_up ($) {
     my $lines = $_[0];
-    $self->view_start ($self->view_start - $lines);
+    $self->view_start (List::Util::min 0, $self->view_start - $lines);
 }

 sub scroll_up_pages ($) {
     my $lines = $_[0] * ($self->nrow - 1);
-    $self->view_start ($self->view_start - $lines);
+    $self->view_start (List::Util::min 0, $self->view_start - $lines);
 }

 sub scroll_down ($) {
     my $lines = $_[0];
-    $self->view_start ($self->view_start + $lines);
+    $self->view_start (List::Util::min 0, $self->view_start + $lines);
 }

 sub scroll_down_pages ($) {
     my $lines = $_[0] * ($self->nrow - 1);
-    $self->view_start ($self->view_start + $lines);
+    $self->view_start (List::Util::min 0, $self->view_start + $lines);
 }

 =item scroll_to_top

-----END OF PAGE-----

-- Response ended

-- Page fetched on Sun Jun 2 11:58:14 2024