summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/todo.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/todo.c b/src/todo.c
index 970991a..8bdd1af 100644
--- a/src/todo.c
+++ b/src/todo.c
@@ -68,6 +68,10 @@ static int todo_cmp(struct todo *a, struct todo *b)
return 1;
if (b->completed && !a->completed)
return -1;
+ if (a->id > 0 && b->id == 0)
+ return -1;
+ if (b->id > 0 && a->id == 0)
+ return 1;
if (a->id == b->id)
return strcmp(a->mesg, b->mesg);