-- 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: 341e15532b9131b2b6cd4bd88622240b0a0c3907:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

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

commit 341e15532b9131b2b6cd4bd88622240b0a0c3907
Author: Marc Lehmann <schmorp@schmorp.de>
Date:   Wed Mar 27 17:24:16 2013 +0000

    if it breaks, the pieces will be sharp

diff --git a/src/command.C b/src/command.C

index a4029f421c1c0adc30058868b9a2167175f154eb..

index ..5ffb952cf550c1d814f9ec3523b6cad3e8190dbe 100644

--- a/src/command.C
+++ b/src/command.C
@@ -512,12 +512,12 @@ rxvt_term::key_press (XKeyEvent &ev)

               if (keysym == XK_Prior)
                 {
-                  scr_page (UP, lnsppg);
+                  scr_page (lnsppg);
                   return;
                 }
               else if (keysym == XK_Next)
                 {
-                  scr_page (DN, lnsppg);
+                  scr_page (-lnsppg);
                   return;
                 }
             }
@@ -526,12 +526,12 @@ rxvt_term::key_press (XKeyEvent &ev)
             {
               if (keysym == XK_Up)
                 {
-                  scr_page (UP, 1);
+                  scr_page (1);
                   return;
                 }
               else if (keysym == XK_Down)
                 {
-                  scr_page (DN, 1);
+                  scr_page (-1);
                   return;
                 }
             }
diff --git a/src/rxvt.h b/src/rxvt.h

index 82791d88af531d4d5d10dbb4a5c5f1a2e7cf9c63..

index ..fd381971e8ea8f9a3f1eb0c51cc19bf7196f7721 100644

--- a/src/rxvt.h
+++ b/src/rxvt.h
@@ -402,9 +402,9 @@ enum {

 /* modes for rxvt_term::scr_page () - scroll page. used by scrollbar window */
 enum page_dirn {
-  UP,
-  DN,
-  NO_DIR,
+  DN     = -1,
+  NO_DIR =  0,
+  UP     =  1,
 };

 /* arguments for rxvt_term::scr_change_screen () */
@@ -1537,7 +1537,11 @@ struct rxvt_term : zero_initialized, rxvt_vars, rxvt_screen
   void scr_charset_choose (int set) NOTHROW;
   void scr_charset_set (int set, unsigned int ch) NOTHROW;
   void scr_move_to (int y, int len) NOTHROW;
-  bool scr_page (enum page_dirn direction, int nlines) NOTHROW;
+  bool scr_page (int nlines) NOTHROW;
+  bool scr_page (enum page_dirn direction, int nlines) NOTHROW
+  {
+    scr_page (direction * nlines);
+  }
   bool scr_changeview (int new_view_start) NOTHROW;
   void scr_bell () NOTHROW;
   void scr_printscreen (int fullhist) NOTHROW;
diff --git a/src/screen.C b/src/screen.C

index 3c81835d639923939c29e4f758efe8568e506ac5..

index ..71f2b91074e87bb30c828f4ada48fbc80e953048 100644

--- a/src/screen.C
+++ b/src/screen.C
@@ -717,7 +717,7 @@ rxvt_term::scr_scroll_text (int row1, int row2, int count) NOTHROW
       if (option (Opt_scrollWithBuffer)
           && view_start != 0
           && view_start != -saveLines)
-        scr_page (UP, count);
+        scr_page (count);

       if (SHOULD_INVOKE (HOOK_SCROLL_BACK))
         HOOK_INVOKE ((this, HOOK_SCROLL_BACK, DT_INT, count, DT_INT, top_row, DT_END));
@@ -1912,13 +1912,9 @@ rxvt_term::scr_move_to (int y, int len) NOTHROW
  * direction should be UP or DN
  */
 bool
-rxvt_term::scr_page (enum page_dirn direction, int nlines) NOTHROW
+rxvt_term::scr_page (int nlines) NOTHROW
 {
-  int new_view_start =
-    direction == UP ? view_start - nlines
-                    : view_start + nlines;
-
-  return scr_changeview (new_view_start);
+  return scr_changeview (view_start - nlines);
 }

 bool

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

-- Response ended

-- Page fetched on Sun Jun 2 10:40:14 2024