Skip to content

Commit 40a5775

Browse files
Fix agenda sorting error. Closes #179.
1 parent ed8a420 commit 40a5775

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lua/orgmode/agenda/views/agenda.lua

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ local function sort_agenda_items(agenda_items)
1515
if not a.headline_date.date_only and not b.headline_date.date_only then
1616
return a.headline_date:is_before(b.headline_date)
1717
end
18-
if not b.headline_date.date_only then
19-
return false
18+
if not a.headline_date.date_only then
19+
return true
2020
end
21-
return true
21+
return false
2222
end
2323

2424
if a.is_same_day and not b.is_same_day then
@@ -37,10 +37,6 @@ local function sort_agenda_items(agenda_items)
3737
return a.headline:get_priority_sort_value() > b.headline:get_priority_sort_value()
3838
end
3939

40-
if a.headline:has_priority() and b.headline:has_priority() then
41-
return a.headline_date:is_before(b.headline_date)
42-
end
43-
4440
return a.headline_date:is_before(b.headline_date)
4541
end)
4642
return agenda_items

0 commit comments

Comments
 (0)