New feature in feature.h: SCROLL_ON_HOMEEND_KEYS
Enables scrolling to the top/bottom of scrollback buffer with
Shift+Home/End.
Marius Gedminas
--
"If it ain't broke, don't fix it."
- Bert Lantz
Index: src/feature.h
===================================================================
RCS file: /cvsroot/rxvt/rxvt/src/feature.h,v
retrieving revision 1.52
diff -u -r1.52 feature.h
--- src/feature.h 2001/03/02 05:33:15 1.52
+++ src/feature.h 2001/03/06 12:54:18
@@ -199,6 +199,14 @@
/* #define SCROLL_ON_UPDOWN_KEYS */
/*
+ * Allow scrolling with modifier+Home/End keys, in addition
+ * to modifier+Prior/Next? (modifier is controlled with
+ * SCROLL_ON_* defines above.) -- mg
+ *
+ */
+/* #define SCROLL_ON_HOMEEND_KEYS */
+
+/*
* Allow unshifted Next/Prior keys to scroll forward/back
* (in addition to shift+Next/shift+Prior) --pjh
*/
Index: src/command.c
===================================================================
RCS file: /cvsroot/rxvt/rxvt/src/command.c,v
retrieving revision 1.202
diff -u -r1.202 command.c
--- src/command.c 2001/03/01 05:07:03 1.202
+++ src/command.c 2001/03/06 12:54:17
@@ -25,6 +25,8 @@
* Copyright (C) 1998,1999,2000 Geoff Wing <[EMAIL PROTECTED]>
* - extensive modifications
* Copyright (C) 1998 Alfredo K. Kojima <[EMAIL PROTECTED]>
+ * Copyright (C) 2001 Marius Gedminas
+ * - scrolling on Shift+Home/End (option)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -161,6 +176,17 @@
}
}
#endif
+#ifdef SCROLL_ON_HOMEEND_KEYS
+ if (IS_SCROLL_MOD) {
+ if (keysym == XK_Home) {
+ rxvt_scr_page(r, UP, r->TermWin.nscrolled);
+ return;
+ } else if (keysym == XK_End) {
+ rxvt_scr_page(r, DN, r->TermWin.nscrolled);
+ return;
+ }
+ }
+#endif
}
if (shft) {
Index: src/screen.c
===================================================================
RCS file: /cvsroot/rxvt/rxvt/src/screen.c,v
retrieving revision 1.197
diff -u -r1.197 screen.c
--- src/screen.c 2001/03/06 05:04:28 1.197
+++ src/screen.c 2001/03/06 12:54:27
@@ -1882,7 +1887,7 @@
start = r->TermWin.view_start;
MAX_IT(nlines, 1);
- MIN_IT(nlines, r->TermWin.nrow);
+ MIN_IT(nlines, r->TermWin.nscrolled);
if (direction == UP) {
n = r->TermWin.view_start + nlines;
r->TermWin.view_start = min(n, r->TermWin.nscrolled);