summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ui.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ui.c b/ui.c
index c2c848f..f44073a 100644
--- a/ui.c
+++ b/ui.c
@@ -826,6 +826,14 @@ static void scrollPage(struct Window *window, int n) {
 	windowScroll(window, n * (MAIN_LINES - SplitLines - MarkerLines - 1));
 }
 
+static void scrollTop(struct Window *window) {
+	for (size_t i = 0; i < BufferCap; ++i) {
+		if (!bufferHard(window->buffer, i)) continue;
+		scrollTo(window, BufferCap - i);
+		break;
+	}
+}
+
 static void scrollHot(struct Window *window, int dir) {
 	for (size_t i = windowTop(window) + dir; i < BufferCap; i += dir) {
 		const struct Line *line = bufferHard(window->buffer, i);
@@ -910,7 +918,7 @@ static void keyCode(int code) {
 		break; case KeyMetaSlash: windowShow(windows.swap);
 
 		break; case KeyMetaGt: scrollTo(window, 0);
-		break; case KeyMetaLt: scrollTo(window, BufferCap);
+		break; case KeyMetaLt: scrollTop(window);
 
 		break; case KeyMeta0 ... KeyMeta9: uiShowNum(code - KeyMeta0);
 		break; case KeyMetaA: showAuto();
ef='/catgirl/commit/ui.c?h=1.7&id=86fac7caadfbefa6f044314d440deefb480133d7&follow=1'>Cast 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