File tree Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -8,12 +8,12 @@ local AgendaFilter = require('orgmode.agenda.filter')
8
8
local utils = require (' orgmode.utils' )
9
9
10
10
local function sort_by_date_or_priority_or_category (a , b )
11
- if not a .headline_date :is_same (b .headline_date ) then
12
- return a .headline_date :is_before (b .headline_date )
13
- end
14
11
if a .headline :get_priority_sort_value () ~= b .headline :get_priority_sort_value () then
15
12
return a .headline :get_priority_sort_value () > b .headline :get_priority_sort_value ()
16
13
end
14
+ if not a .headline_date :is_same (b .headline_date , ' day' ) then
15
+ return a .headline_date :is_before (b .headline_date )
16
+ end
17
17
return a .index < b .index
18
18
end
19
19
22
22
local function sort_agenda_items (agenda_items )
23
23
table.sort (agenda_items , function (a , b )
24
24
if a .is_same_day and b .is_same_day then
25
- if not a .headline_date .date_only and not b .headline_date .date_only then
26
- return a .headline_date :is_before (b .headline_date )
27
- end
28
- if not a .headline_date .date_only then
25
+ if not a .headline_date .date_only and b .headline_date .date_only then
29
26
return true
30
27
end
31
- if not b .headline_date .date_only then
28
+ if not b .headline_date .date_only and a . headline_date . date_only then
32
29
return false
33
30
end
34
31
return sort_by_date_or_priority_or_category (a , b )
Original file line number Diff line number Diff line change @@ -129,17 +129,17 @@ local function indentexpr()
129
129
match = match or {}
130
130
prev_line_match = prev_line_match or {}
131
131
132
- if match .type == ' headline' then
133
- return 0
134
- end
135
-
136
132
if prev_line_match .type == ' headline' then
137
- if noindent_mode then
133
+ if noindent_mode or ( match . type == ' headline ' and match . stars > 0 ) then
138
134
return 0
139
135
end
140
136
return prev_line_match .indent
141
137
end
142
138
139
+ if match .type == ' headline' then
140
+ return 0
141
+ end
142
+
143
143
if match .type == ' list' and prev_line_match .type == ' list' then
144
144
local prev_line_list_item = get_is_list_item (vim .fn .getline (prev_linenr ))
145
145
local cur_line_list_item = get_is_list_item (vim .fn .getline (vim .v .lnum ))
You can’t perform that action at this time.
0 commit comments