summary refs log tree commit diff
path: root/ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui.c')
-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);
9 -0500'>2020-02-11Add note about setting PKG_CONFIG_PATHJune McEnroe 2020-02-11Rename query ID on nick changeJune McEnroe 2020-02-11Call completeClear when closing a windowJune McEnroe 2020-02-11Don't insert color codes for non-mentionsJune McEnroe 2020-02-11Take first two words in colorMentionsJune McEnroe This lets phrases like "hi june" get colored, but still doesn't get carried away. 2020-02-11Use time_t for save signatureJune McEnroe It's actually more likely to be 64-bit than size_t anyway, and it eliminates some helper functions. Also don't error when reading an empty save file. 2020-02-11Set self.nick to * initiallyJune McEnroe Allows removing a bunch of checks that self.nick is set, and it's what the server usually calls you before registration. Never highlight notices as mentions. 2020-02-11Define ColorCap instead of hardcoding 100June McEnroe 2020-02-11Move hash to top of chat.hJune McEnroe 2020-02-11Move base64 out of chat.hJune McEnroe 2020-02-11Move XDG_SUBDIR out of chat.hJune McEnroe 2020-02-11Fix whois idle unit calculationJune McEnroe Rookie mistake. 2020-02-11Cast towupper to wchar_tJune McEnroe For some reason it takes and returns wint_t... 2020-02-11Cast set but unused variables to voidJune McEnroe 2020-02-11Declare strlcatJune McEnroe 2020-02-11Check if VDSUSP existsJune McEnroe 2020-02-11Fix completeReplace iterationJune McEnroe 2020-02-11Use pkg(8) to configure on FreeBSDJune McEnroe 2020-02-11Remove legacy codeJune McEnroe 2020-02-11Add INSTALLING section to READMEJune McEnroe