Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions src/Modules/BuildListHelpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -146,21 +146,20 @@ local function SortList(list, sortMode)
if a_is_folder and not b_is_folder then return true end
if not a_is_folder and b_is_folder then return false end

local aPathName = (a.subPath or "") .. (a.folderName or a.fileName or "")
local bPathName = (b.subPath or "") .. (b.folderName or b.fileName or "")

if sortMode == "EDITED" then
local modA = a.modified or 0
local modB = b.modified or 0
if modA ~= modB then
return modA > modB
end
if a_is_folder then
return naturalSortCompare(a.folderName, b.folderName)
else
return naturalSortCompare(a.fileName, b.fileName)
end
return naturalSortCompare(aPathName, bPathName)
end

if a_is_folder then
return naturalSortCompare(a.folderName, b.folderName)
return naturalSortCompare(aPathName, bPathName)
else
if sortMode == "CLASS" then
local a_has_class = a.className ~= nil
Expand All @@ -178,16 +177,16 @@ local function SortList(list, sortMode)
elseif a_has_asc and b_has_asc and a.ascendClassName ~= b.ascendClassName then
return a.ascendClassName < b.ascendClassName
end
return naturalSortCompare(a.fileName, b.fileName)
return naturalSortCompare(aPathName, bPathName)
elseif sortMode == "LEVEL" then
if a.level and not b.level then return false
elseif not a.level and b.level then return true
elseif a.level and b.level then
if a.level ~= b.level then return a.level < b.level end
end
return naturalSortCompare(a.fileName, b.fileName)
return naturalSortCompare(aPathName, bPathName)
else
return naturalSortCompare(a.fileName, b.fileName)
return naturalSortCompare(aPathName, bPathName)
end
end
end)
Expand Down
Loading