summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-08-06 15:07:56 -0400
committerJune McEnroe <june@causal.agency>2019-08-06 15:07:56 -0400
commitdf46e00f602aa4291c52014f09ca23a86aad5893 (patch)
treeb46a97314fa739b193113800c0e6bf35a9404859
parentFactor out scrolling (diff)
downloadstream-df46e00f602aa4291c52014f09ca23a86aad5893.tar.gz
stream-df46e00f602aa4291c52014f09ca23a86aad5893.zip
Implement SU and SD
-rw-r--r--term.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/term.c b/term.c
index 18eeb66..e77ab67 100644
--- a/term.c
+++ b/term.c
@@ -248,6 +248,8 @@ enum CSI {
 	EL,
 	DL  = 'M',
 	DCH = 'P',
+	SU  = 'S',
+	SD  = 'T',
 	ECH = 'X',
 	VPA = 'd',
 	SM  = 'h',
@@ -331,6 +333,9 @@ static char updateCSI(wchar_t ch) {
 			clear(cell(y, cols - i), cell(y, cols - 1));
 		}
 
+		break; case SU: scrollUp(MIN((n ? ps[0] : 1), scroll.bot - scroll.top));
+		break; case SD: scrollDown(MIN((n ? ps[0] : 1), scroll.bot - scroll.top));
+
 		break; case SM: {
 			switch (ps[0]) {
 				break; case IRM: insert = true;
@@ -347,6 +352,7 @@ static char updateCSI(wchar_t ch) {
 		break; case SGR: updateSGR(ps, p + 1);
 
 		break; case DECSTBM: {
+			// FIXME: Prevent bot < top.
 			scroll.top = (n > 0 ? ps[0] - 1 : 0);
 			scroll.bot = (n > 1 ? ps[1] - 1 : rows - 1);
 		}
rJune McEnroe 2021-01-13Fix C lexer to require a digit in a float literalJune McEnroe 2021-01-13Support long double in c.shJune McEnroe 2021-01-13Update Terminal.app coloursJune McEnroe 2021-01-13Increase dark white brightness slightlyJune McEnroe 2021-01-13Add hilex example to htagml manualJune McEnroe 2021-01-12Style causal.agency like bin HTMLJune McEnroe 2021-01-12Avoid matching tag text inside HTML elementsJune McEnroe 2021-01-12Use hilex for up -hJune McEnroe 2021-01-12Use hilex for bin HTMLJune McEnroe 2021-01-12Don't output a pre in hilex by defaultJune McEnroe 2021-01-12Move hilex out of hilex directoryJune McEnroe 2021-01-12Consolidate hilex formatters into hilex.cJune McEnroe 2021-01-12Remove hacky tagging from hilexJune McEnroe 2021-01-12Add htagml -iJune McEnroe 2021-01-12Render tag index in HTMLJune McEnroe 2021-01-12Add htagml -xJune McEnroe 2021-01-12Prevent matching the same tag twiceJune McEnroe 2021-01-12Process htagml file line by lineJune McEnroe 2021-01-12Split fields by tab onlyJune McEnroe 2021-01-12List both Makefile and html.sh under README.7June McEnroe 2021-01-12Add htagml exampleJune McEnroe 2021-01-12Use mandoc and htagml for bin htmlJune McEnroe 2021-01-12Add htagmlJune McEnroe 2021-01-12Replace causal.agency with a simple mdoc pageJune McEnroe 2021-01-11Publish "Using vi"June McEnroe 2021-01-11Enable diff.colorMovedJune McEnroe 2021-01-10Set less search case-insensitiveJune McEnroe 2021-01-10Set EXINITJune McEnroe 2021-01-09Add c -t flag to print expression typeJune McEnroe 2021-01-05Update taglineJune McEnroe