diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-04-28 20:15:30 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-04-28 20:15:30 -0700 |
commit | f118762f9771ac64e1b8e0987be1eeddb663298a (patch) | |
tree | 3b37f9479014eb082a2349bd7b9eff8e60673d5d | |
parent | 1a99270e6d3e6a519b33b4deef749bdd55ccce1c (diff) | |
download | pw-f118762f9771ac64e1b8e0987be1eeddb663298a.tar.gz pw-f118762f9771ac64e1b8e0987be1eeddb663298a.tar.bz2 pw-f118762f9771ac64e1b8e0987be1eeddb663298a.zip |
New + command to increase display height.
-rw-r--r-- | pw.1 | 8 | ||||
-rw-r--r-- | pw.c | 10 |
2 files changed, 17 insertions, 1 deletions
@@ -217,6 +217,12 @@ recall using the up and down arrow keys or and .BR Ctrl-N . +.IP \fB+\fP +Increases the display size by one line. This doesn't come into effect +immediately; the newly opened position must be filled by a line of data +from standard input. There is no way to reduce the size dynamically. +Resizing beyond the terminal height is not permitted, if the height is known. + .IP \fBCtrl-Z\fI Suspends .IR pw , @@ -372,7 +378,7 @@ The program uses hard-coded ANSI sequences, so it doesn't support interesting old terminals. On the other hand, it carries no dependency on any terminal abstraction library/data. -The intervals and number of lines cannot be dynamically adjusted. +The intervals cannot be dynamically adjusted. There is no support for unwrapping long lines, which would be useful for copy and paste. @@ -692,6 +692,16 @@ int main(int argc, char **argv) cmdbuf[1] = 0; curcmd = cmdbuf; break; + case '+': + if (ws.ws_row && maxlines >= ws.ws_row - 1) + break; + maxlines++; + if ((circbuf = realloc(circbuf, sizeof *circbuf * maxlines)) == 0) + panic("out of memory"); + if ((snapshot = realloc(snapshot, sizeof *snapshot * maxlines)) == 0) + panic("out of memory"); + snapshot[maxlines-1] = circbuf[maxlines-1] = 0; + break; } break; case kbd_esc: |