mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-25 09:06:22 +00:00
Allow forwards though input history
This commit is contained in:
14
input_win.c
14
input_win.c
@@ -125,7 +125,7 @@ void inp_poll_char(int *ch, char *input, int *size)
|
||||
|
||||
// up arrow
|
||||
} else if (*ch == KEY_UP) {
|
||||
char *prev = inpbuf_get_previous();
|
||||
char *prev = inpbuf_previous();
|
||||
if (prev) {
|
||||
strcpy(input, prev);
|
||||
*size = strlen(input);
|
||||
@@ -135,6 +135,18 @@ void inp_poll_char(int *ch, char *input, int *size)
|
||||
waddch(inp_win, input[i]);
|
||||
}
|
||||
|
||||
// down arrow
|
||||
} else if (*ch == KEY_DOWN) {
|
||||
char *next = inpbuf_next();
|
||||
if (next) {
|
||||
strcpy(input, next);
|
||||
*size = strlen(input);
|
||||
inp_clear();
|
||||
int i;
|
||||
for (i = 0; i < *size; i++)
|
||||
waddch(inp_win, input[i]);
|
||||
}
|
||||
|
||||
// else if not error, newline or special key,
|
||||
// show it and store it
|
||||
} else if (*ch != ERR &&
|
||||
|
||||
Reference in New Issue
Block a user