improv(moveToFolderInCwd): initially sort by mtime

remotes/origin/HEAD
Chris Grieser 2024-02-10 20:29:57 +01:00
parent 47863d8acb
commit 497e6f45fb
1 changed files with 7 additions and 0 deletions

View File

@ -138,6 +138,13 @@ function M.moveToFolderInCwd()
return not ignoreDirs
end, { type = "directory", limit = math.huge })
-- sort by modification time
table.sort(subfoldersOfCwd, function(a, b)
local aMtime = vim.loop.fs_stat(a).mtime.sec
local bMtime = vim.loop.fs_stat(b).mtime.sec
return aMtime > bMtime
end)
-- prompt user and move
local promptStr = "Choose Destination Folder"
if supportsImportUpdates then promptStr = promptStr .. " (with updated imports)" end