summary refs log tree commit diff
path: root/ui.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ui.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/ui.c b/ui.c
index cdb2883..6fe7061 100644
--- a/ui.c
+++ b/ui.c
@@ -519,6 +519,11 @@ static void windowScroll(struct Window *window, int n) {
 	unmark(window);
 }
 
+static void windowScrollPage(struct Window *window, int n) {
+	// -1 for split marker, -1 for line of overlap.
+	windowScroll(window, n * (PAGE_LINES - SplitLines - 2));
+}
+
 static void windowScrollUnread(struct Window *window) {
 	window->scroll = 0;
 	windowScroll(window, window->unreadSoft - PAGE_LINES + 1);
@@ -931,7 +936,7 @@ static void keyCode(int code) {
 		break; case KeyMetaM: waddch(window->pad, '\n');
 		break; case KeyMetaQ: edit(id, EditCollapse, 0);
 		break; case KeyMetaU: windowScrollUnread(window);
-		break; case KeyMetaV: windowScroll(window, +(PAGE_LINES - 2));
+		break; case KeyMetaV: windowScrollPage(window, +1);
 
 		break; case KEY_BACKSPACE: edit(id, EditDeletePrev, 0);
 		break; case KEY_DC: edit(id, EditDeleteNext, 0);
@@ -940,8 +945,8 @@ static void keyCode(int code) {
 		break; case KEY_ENTER: edit(id, EditEnter, 0);
 		break; case KEY_HOME: edit(id, EditHead, 0);
 		break; case KEY_LEFT: edit(id, EditPrev, 0);
-		break; case KEY_NPAGE: windowScroll(window, -(PAGE_LINES - 2));
-		break; case KEY_PPAGE: windowScroll(window, +(PAGE_LINES - 2));
+		break; case KEY_NPAGE: windowScrollPage(window, -1);
+		break; case KEY_PPAGE: windowScrollPage(window, +1);
 		break; case KEY_RIGHT: edit(id, EditNext, 0);
 		break; case KEY_SEND: windowScroll(window, -WindowLines);
 		break; case KEY_SHOME: windowScroll(window, +WindowLines);
@@ -969,7 +974,7 @@ static void keyCtrl(wchar_t ch) {
 		break; case L'P': uiShowNum(windows.show - 1);
 		break; case L'T': edit(id, EditTranspose, 0);
 		break; case L'U': edit(id, EditDeleteHead, 0);
-		break; case L'V': windowScroll(window, -(PAGE_LINES - 2));
+		break; case L'V': windowScrollPage(window, -1);
 		break; case L'W': edit(id, EditDeletePrevWord, 0);
 		break; case L'X': edit(id, EditExpand, 0);
 		break; case L'Y': edit(id, EditPaste, 0);
e status line is now at the top. The status formatting still needs to be reworked. I also want to try showing the nick in the input window so it really looks like your next message. 2018-09-12Add note about C-oJune McEnroe Why are there so few well usable ctrl key bindings? 2018-09-12Use formatParse split to position input cursorJune McEnroe 2018-09-12Factor out IRC formatting parsingJune McEnroe 2018-09-11Add /help equivalent to /manJune McEnroe 2018-09-11Don't render every PM as a pingJune McEnroe 2018-09-11Add urlOpenMatchJune McEnroe 2018-09-10Depend on man.sh for chroot.tar targetJune McEnroe 2018-09-10Set LESSSECURE=1 in man.shJune McEnroe Ridiculous. 2018-09-10Add /man commandJune McEnroe 2018-09-10Install man page in chrootJune McEnroe 2018-09-10Install man pageJune McEnroe 2018-09-10Split keys into subsections and document colorsJune McEnroe 2018-09-10Add "blank" lines to chatte.1June McEnroe 2018-09-10Document key bindings in chatte.1June McEnroe 2018-09-08Document slash commands in chatte.1June McEnroe