File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 6262utils .get_entries = function (opts )
6363 --- @type { file : OrgApiFile , filename : string , last_used : number } []
6464 local file_results = vim .tbl_map (function (file )
65- return { file = file , filename = file .filename }
65+ local file_stat = vim .loop .fs_stat (file .filename ) or 0
66+ return { file = file , filename = file .filename , last_used = file_stat .mtime .sec }
6667 end , orgmode .load ())
6768
6869 if not opts .archived then
@@ -71,6 +72,11 @@ utils.get_entries = function(opts)
7172 end , file_results )
7273 end
7374
75+ -- sorting does not work with the fuzzy sorters
76+ table.sort (file_results , function (a , b )
77+ return a .last_used > b .last_used
78+ end )
79+
7480 if opts .state and opts .state .current and opts .state .current .max_depth == 0 then
7581 return index_orgfiles (file_results , opts )
7682 end
@@ -94,7 +100,6 @@ utils.make_entry = function(opts)
94100 items = {
95101 { width = vim .F .if_nil (opts .location_width , 20 ) },
96102 { remaining = true },
97- -- { width = vim.F.if_nil(opts.tag_width, 20) },
98103 },
99104 })
100105
You can’t perform that action at this time.
0 commit comments