Allow discarding a todo item from the priority prompt

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
Lukas Fleischer 2019-10-03 11:41:09 -04:00
parent ade5216f68
commit f49ec4ad6e

View File

@ -67,9 +67,11 @@ void ui_todo_add(void)
GETSTRING_VALID) { GETSTRING_VALID) {
do { do {
status_mesg(mesg_id, ""); status_mesg(mesg_id, "");
if ((ch = keys_wgetch(win[KEY].p)) == RETURN) { ch = keys_wgetch(win[KEY].p);
if (ch == RETURN)
ch = '0'; ch = '0';
} else if (ch == ESCAPE)
return;
} while (!isdigit(ch)); } while (!isdigit(ch));
struct todo *todo = todo_add(todo_input, ch - '0', 0, NULL); struct todo *todo = todo_add(todo_input, ch - '0', 0, NULL);
ui_todo_load_items(); ui_todo_load_items();