more: add space binding

This commit is contained in:
K. Lange 2021-09-20 19:50:06 +09:00
parent 99b9a20651
commit 04b117af31
1 changed files with 16 additions and 10 deletions

View File

@ -123,16 +123,22 @@ static void next_line(void) {
char buf[1];
read(STDERR_FILENO, buf, 1);
char c = buf[0];
if (c == '\n' || c == '\r') {
printf("\r\033[K");
fflush(stdout);
term_x = 0;
return;
} else if (c == 'q') {
printf("\r\033[K");
fflush(stdout);
set_buffered();
exit(0);
switch (c) {
case ' ':
term_yish = 1;
/* fallthrough */
case '\n':
case '\r':
printf("\r\033[K");
fflush(stdout);
term_x = 0;
return;
case 'q':
printf("\r\033[K");
fflush(stdout);
set_buffered();
exit(0);
return;
}
} while (1);
}