aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2019-10-03 11:41:09 -0400
committerLukas Fleischer <lfleischer@calcurse.org>2019-11-03 10:56:47 -0500
commitf49ec4ad6e2035d056583340a13edb46d17ba8d1 (patch)
tree9ca4f5c1e5f8b8f6e05a4ef298247a607427f649
parentade5216f685e75d48f1c6e99327e380b96b650ea (diff)
downloadcalcurse-f49ec4ad6e2035d056583340a13edb46d17ba8d1.tar.gz
calcurse-f49ec4ad6e2035d056583340a13edb46d17ba8d1.zip
Allow discarding a todo item from the priority prompt
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
-rw-r--r--src/ui-todo.c6
1 files 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();