Display priority todo items above regular items

We now support todo items with undefined priority and currently display
them above todo items with a strictly positive priority. Change this and
always list items with a priority greater than zero first.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
Lukas Fleischer 2016-01-27 23:56:39 +01:00
parent ebe483c058
commit d127ce9447

View File

@ -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);