From f49ec4ad6e2035d056583340a13edb46d17ba8d1 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Thu, 3 Oct 2019 11:41:09 -0400 Subject: Allow discarding a todo item from the priority prompt Signed-off-by: Lukas Fleischer --- src/ui-todo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ui-todo.c b/src/ui-todo.c index 6b20621..8834e39 100644 --- a/src/ui-todo.c +++ b/src/ui-todo.c @@ -67,9 +67,11 @@ void ui_todo_add(void) GETSTRING_VALID) { do { status_mesg(mesg_id, ""); - if ((ch = keys_wgetch(win[KEY].p)) == RETURN) { + ch = keys_wgetch(win[KEY].p); + if (ch == RETURN) ch = '0'; - } + else if (ch == ESCAPE) + return; } while (!isdigit(ch)); struct todo *todo = todo_add(todo_input, ch - '0', 0, NULL); ui_todo_load_items(); -- cgit v1.2.3-54-g00ecf