diff options
author | Lukas Fleischer <lfleischer@calcurse.org> | 2016-01-17 22:54:12 +0100 |
---|---|---|
committer | Lukas Fleischer <lfleischer@calcurse.org> | 2016-01-18 18:08:45 +0100 |
commit | e3ac5542aa1be85ae1116eea44142f85c80b4a34 (patch) | |
tree | bd835796f150a4e26fb49faa34615c33840581d1 /src/ui-todo.c | |
parent | beea88e5feb6f14b4912c6aa4878c39a7632977c (diff) | |
download | calcurse-e3ac5542aa1be85ae1116eea44142f85c80b4a34.zip |
Support todo items with an undefined priority
In addition to priorities 1-9, support todo items without any specific
priority, internally represented by priority 0.
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/ui-todo.c')
-rw-r--r-- | src/ui-todo.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ui-todo.c b/src/ui-todo.c index 2a03844..de19272 100644 --- a/src/ui-todo.c +++ b/src/ui-todo.c @@ -50,13 +50,13 @@ void ui_todo_add(void) int ch = 0; const char *mesg = _("Enter the new TODO item:"); const char *mesg_id = - _("Enter the TODO priority [1 (highest) - 9 (lowest)]:"); + _("Enter the TODO priority [0 (none), 1 (highest) - 9 (lowest)]:"); char todo_input[BUFSIZ] = ""; status_mesg(mesg, ""); if (getstring(win[STA].p, todo_input, BUFSIZ, 0, 1) == GETSTRING_VALID) { - while ((ch < '1') || (ch > '9')) { + while ((ch < '0') || (ch > '9')) { status_mesg(mesg_id, ""); ch = wgetch(win[KEY].p); } @@ -259,8 +259,8 @@ void ui_todo_chg_priority(int diff) int id = item->id + diff; struct todo *item_new; - if (id < 1) - id = 1; + if (id < 0) + id = 0; else if (id > 9) id = 9; |