From 098eb7ffeca8eac42c2c78d7d8b1372c267168d7 Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Thu, 12 Oct 2023 06:12:49 +0000 Subject: [PATCH] fix: trash mtime should be sortable --- lua/oil/adapters/trash/freedesktop.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/oil/adapters/trash/freedesktop.lua b/lua/oil/adapters/trash/freedesktop.lua index 2a4d48a5..00bfd214 100644 --- a/lua/oil/adapters/trash/freedesktop.lua +++ b/lua/oil/adapters/trash/freedesktop.lua @@ -353,6 +353,17 @@ file_columns.mtime = { return ret end, + get_sort_value = function(entry) + local meta = entry[FIELD_META] + ---@type nil|oil.TrashInfo + local trash_info = meta.trash_info + if trash_info then + return trash_info.deletion_date + else + return 0 + end + end, + parse = function(line, conf) local fmt = conf and conf.format local pattern