mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-24 13:45:00 +00:00
feature: use numeric sorting for all trees (#597)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
12bb915bd8
commit
76a7a2228f
4 changed files with 78 additions and 6 deletions
|
@ -194,9 +194,9 @@ namespace SourceGit.ViewModels
|
|||
return -1;
|
||||
|
||||
if (l.Backend is Models.Branch)
|
||||
return r.Backend is Models.Branch ? string.Compare(l.Name, r.Name, StringComparison.Ordinal) : 1;
|
||||
return r.Backend is Models.Branch ? Models.NumericSort.Compare(l.Name, r.Name) : 1;
|
||||
|
||||
return r.Backend is Models.Branch ? -1 : string.Compare(l.Name, r.Name, StringComparison.Ordinal);
|
||||
return r.Backend is Models.Branch ? -1 : Models.NumericSort.Compare(l.Name, r.Name);
|
||||
});
|
||||
|
||||
foreach (var node in nodes)
|
||||
|
|
|
@ -114,9 +114,9 @@ namespace SourceGit.ViewModels
|
|||
|
||||
nodes.Sort((l, r) =>
|
||||
{
|
||||
if (l.IsFolder)
|
||||
return r.IsFolder ? string.Compare(l.FullPath, r.FullPath, StringComparison.Ordinal) : -1;
|
||||
return r.IsFolder ? 1 : string.Compare(l.FullPath, r.FullPath, StringComparison.Ordinal);
|
||||
if (l.IsFolder == r.IsFolder)
|
||||
return Models.NumericSort.Compare(l.FullPath, r.FullPath);
|
||||
return r.IsFolder ? -1 : 1;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue