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:
parent
ebe483c058
commit
d127ce9447
@ -68,6 +68,10 @@ static int todo_cmp(struct todo *a, struct todo *b)
|
|||||||
return 1;
|
return 1;
|
||||||
if (b->completed && !a->completed)
|
if (b->completed && !a->completed)
|
||||||
return -1;
|
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)
|
if (a->id == b->id)
|
||||||
return strcmp(a->mesg, b->mesg);
|
return strcmp(a->mesg, b->mesg);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user